<    March 2017    >
Su Mo Tu We Th Fr Sa  
          1  2  3  4  
 5  6  7  8  9 10 11  
12 13 14 15 16 17 18  
19 20 21 22 23 24 25  
26 27 28 29 30 31
00:00 defaultnick___ joined
00:02 takle joined
00:02 anuxivm left
00:04 markus1199 joined
00:04 <okeuday_bak> isn't it possible to have something like: let x = do { .,... multiple lines .... } in x ?
00:04 markus1219 joined
00:05 takle_ joined
00:05 <Koterpillar> okeuday_bak: yes, separate "lines" with ;
00:05 <centril> okeuday_bak: seems awfully redundant tho
00:05 <ski> (s/lines/commands/)
00:05 <ski> if you use layout, then you don't need `;'s there
00:06 <okeuday_bak> ski: k
00:06 <ski> note that the body of the `do' must be indented more than `x' in that case
00:06 <glguy> I'm just wondering what that comma is going hiding amongst all those periods
00:06 <glguy> seems suspicious
00:06 <glguy> is doing*
00:06 <ski> illegal alien
00:06 <centril> glguy: haha, nice catch
00:06 <okeuday_bak> mistype
00:06 <geekosaur> just means tey type like i do >.>
00:06 Swizec joined
00:07 <centril> ski: seems that function needs to build a wall.
00:07 <* ski> doesn't understand
00:07 refold joined
00:07 <ski> (which function ?)
00:07 <centril> that the let binding is in
00:07 <centril> alternatively, GHC needs to build a wall
00:08 <ski> it need not be
00:08 <okeuday_bak> centril: yeah, attempting to return x as Right x, so it is wrapped in an Either
00:08 <okeuday_bak> it is somewhat wall-like
00:08 <centril> okeuday_bak: like a fence?
00:08 <* ski> . o O ( "warn all" )
00:08 <okeuday_bak> centril: I was hoping to avoid having exceptions escape
00:09 <centril> okeuday_bak: watcha doing ?
00:09 <okeuday_bak> centril: trying to use binary Put without exceptions and have it return a String error or even an Error type in an Either type
00:10 <okeuday_bak> centril: however, I get odd errors when attempting to use do syntax normally, since it expects Either in the do syntax usage, as if each line would have Right as a prefix
00:10 <centril> Put :: ?
00:10 <okeuday_bak> https://hackage.haskell.org/package/binary-
00:10 takle_ joined
00:11 dolio joined
00:11 <glguy> okeuday_bak: If you've got some actual broken code you can share it via lpaste.net
00:11 <okeuday_bak> centril: binary Get isn't a problem, because it provides strings coming from fail usage, its just the Put usage which is an issue, since it doesn't provide a function that handles errors, since no errors would happen within the binary source code, just doing extra checking
00:12 <okeuday_bak> glguy: https://github.com/okeuday/erlang_hs/blob/master/src/Foreign/Erlang.hs#L454-L647 is the code I want to improve to avoid any exceptions being thrown
00:13 <okeuday_bak> currently, outputError is using fail, which causes an exception to be thrown
00:14 shayan_ joined
00:14 skeuomorf joined
00:14 <centril> okeuday_bak: so if you want to capture errors you need to encode that in the type... So Either Err Put... ?
00:15 <okeuday_bak> it doesn't seem clear to me whether this requires a monad transform to attach a String or Error type unto the Put monad, haven't really learned about transforms yet
00:15 defaultnick___ joined
00:15 <okeuday_bak> centril: yes, that is what I was attempting to do
00:16 plutoniix joined
00:16 <centril> okeuday_bak: OK, so the shape of your computation is similar to: WriterT (Except Err) ()
00:17 <okeuday_bak> centril: I wasn't sure how the Writer monad really works, the PutM type takes something, but Put sets it as (), so just not sure how PutM a uses a
00:17 <centril> oh wait...
00:17 plutoniix joined
00:17 <okeuday_bak> centril: I had expected that to be a detail related to being a Writer monad that is just merging pairs of things
00:17 <centril> okeuday_bak: the result is in the "writer" part of the monoid
00:18 fre2 joined
00:18 _sras_ joined
00:19 <centril> okeuday_bak: unfortunately, the PutM type has no corresponding transformer
00:19 handlex joined
00:19 <okeuday_bak> centril: yeah, I was expecting to have to use mtl to wrap an error, if Either couldn't be used here
00:19 <centril> so you have to build the MonadError interface + the functions already made for PutM over it
00:20 <okeuday_bak> and MonadError is https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Error-Class.html right?
00:21 <centril> okeuday_bak: Just say: newtype EPutM e a = EPutM { _runEPutM :: Either e (PutM a) }
00:21 fre3 joined
00:21 <centril> okeuday_bak: that's correct
00:22 <okeuday_bak> centril: Ok, thanks, I probably should read more before doing more though
00:22 <centril> then you need to build a bunch of functions that work with EPutM now instead
00:22 <okeuday_bak> centril: so I basically will need all my own put functions for all the different bits I may write, right?
00:22 theDon_ joined
00:23 <centril> okeuday_bak: it is pretty straight forward... you can make a higher order function that does :: (a -> Put) -> (a -> EPutM ())
00:23 <okeuday_bak> centril: k, cool
00:23 oisdk joined
00:23 <okeuday_bak> centril: thanks for the insight
00:25 <centril> call it: liftPut :: (a -> Put) -> (a -> EPutM ()) ; liftPut f = EPutM . pure . f ;
00:26 <centril> okeuday_bak: then just take every function of the form :: a -> Put , for some a... for example: putWord8
00:27 <okeuday_bak> centril: ok, thanks
00:27 <centril> yw =)
00:28 fre2 joined
00:28 exferenceBot joined
00:29 jmcarthur joined
00:29 louispan joined
00:29 chrisdotcode joined
00:30 nakal joined
00:31 Swizec joined
00:31 ramzifu joined
00:32 mikeyhew_ joined
00:33 kefin joined
00:33 JuanDaugherty joined
00:37 <lpaste_> mzabani pasted “Can't write a monad transformer that is an instance of MonadReader” at http://lpaste.net/353281
00:37 andyhuzhill joined
00:38 fre3 joined
00:38 yfeldblum joined
00:38 <Koterpillar> mzabani: if you have a ReaderT unconditionally, you don't need to have a constraint
00:38 <glguy> You'll have an instance MonadReader Int (TunnelT m)
00:39 <Koterpillar> mzabani: if you _do_ have a constraint, that means you are requiring two Readers in your stack
00:39 mizu_no_oto_work joined
00:39 <mzabani> the title is a little wrong, guys, sorry: it is more like creating MonadReader instances automatically when the underlying monad is MonadReader
00:39 <glguy> or probably closer to: instance Monad m => MonadReader Int (TunnelT m)
00:39 <mzabani> the ReaderT in the implementation is just because TunnelT is just a special kind of ReaderT
00:40 certainty joined
00:40 <glguy> It's generally better not to write this instance, however
00:40 <Koterpillar> mzabani: OK, you still don't need that constraint
00:40 <glguy> You can have some definition: getWhateverTheIntMeans :: TunnelT m Int
00:41 <glguy> if it's appropriate to expose that Int, or if it's not you can write the actual operation in terms of that
00:41 fre2 joined
00:41 dustmote_ joined
00:41 <mzabani> what I really want is not to expose the Int
00:41 <glguy> OK, then don't write the isntance
00:42 gugah joined
00:42 <mzabani> but how do I make sure that users of TunnelT keep their underlying MonadReaders accessible?
00:42 <glguy> Oh, that's a different question. you just need to 'lift' the ask operation or ask
00:42 <Koterpillar> write an instance of MonadTrans?
00:44 dfeuer joined
00:44 <mzabani> hmm haven't tried using lift yet..
00:45 <mzabani> I was scratching my head over and over with MonadReader's functions... but couldn't typecheck
00:46 <mzabani> so I have to make TunnelT an instance of MonadTrans first.. right?
00:48 cosmodanger joined
00:48 <Koterpillar> yes, then you'll get 'lift ask' and such
00:48 <glguy> ask = TunnelT (lift ask); local f (TunnelT m) = TunnelT (mapReaderT (local f) m)
00:48 Textmode joined
00:48 <glguy> You *can* write the MonadTrans instance
00:48 <glguy> and use that
00:49 <glguy> (probably a good idea)
00:49 coltfred_ joined
00:50 codesoup joined
00:51 defaultnick_ joined
00:51 <glguy> mapReaderT :: (m a -> n b) -> ReaderT r m a -> ReaderT r n b
00:52 <mzabani> that's a lot of help.. thank you once again
00:52 <mzabani> I'll go scratch my head on implementing lift now..
00:54 pleax joined
00:55 Ranhir joined
00:55 Sh4pe joined
00:57 minn joined
00:57 le_frogballs joined
00:58 eacameron joined
01:00 buglebud_ joined
01:00 conal joined
01:04 Levex joined
01:05 steeze joined
01:05 lambda-11235 joined
01:06 FreeBirdLjj joined
01:09 nighty joined
01:12 patbecich joined
01:14 GreySunshine joined
01:14 Rotaerk joined
01:14 <mzabani> guys, sorry to bother you again with this... but how can I implement lift without knowing anything about the underlying Monad?
01:14 <ezyang> mzabani: No.
01:14 <ezyang> Well, depends on what you mean
01:16 <mzabani> while trying to make my monad transformer an instance of MonadTrans, how can I separate "m" from "a" in "m a" to build "t m a" in lift?
01:17 xektor joined
01:17 <glguy> lift :: m a -> ReaderT m a
01:18 <Rotaerk> why do you want to separate the m from the a?
01:18 <glguy> lift :: m a -> ReaderT r m a
01:18 <glguy> TunnelT :: ReaderT r m a -> TunnelT m a
01:20 FreeBirdLjj joined
01:21 <monochrom> You don't have an unknown "t". It is your own transformer. You know how to implement lift for it.
01:21 <monochrom> But look at how StateT and ReaderT do it for examples.
01:21 patbecich joined
01:22 <mzabani> oh gosh.. glguy just showed me what I had to see
01:22 conal joined
01:22 <mzabani> thank you once again, I still have a hard time remembering the functions that are there for me to use most of the time.. it's been kind of a steep learning curve here
01:23 <Rotaerk> the haskell mountain is steep everywhere
01:24 cschneid_ joined
01:24 <mzabani> indeed it is
01:25 cschnei__ joined
01:26 <Koterpillar> then it can't be finite
01:26 eacameron joined
01:27 defaultnick_ joined
01:30 <Rotaerk> well, I guess I shouldn't call it a mountain; it's more like a rabbit hole
01:30 <Rotaerk> though when I said steep everywhere, I really meant from every angle, rather than at ever elevation
01:30 <Rotaerk> every *
01:30 <monochrom> There is a Schwarzchild radius.
01:34 Textmode joined
01:36 serendependy joined
01:37 jodor joined
01:40 skeet70 joined
01:41 halogenandtoast joined
01:41 Welkin joined
01:43 le_frogballs joined
01:43 hexagoxel joined
01:43 mikeyhew_ left
01:43 orbifx joined
01:44 cschneid_ joined
01:47 theelous3 joined
01:47 arand joined
01:47 <c_wraith> Haskell feels infinite. but that's because ghc keeps advancing. so much to keep learning.
01:48 <c_wraith> I just learned that TypeInType allows higher-rank kinds. except they're not called kinds anymore. unless.. Do we still call them kinds?
01:48 <c_wraith> type-types?
01:50 <centril> c_wraith: kinds were always type of types
01:50 texasmynsted joined
01:50 eklavya joined
01:50 daniel-s joined
01:50 <centril> just as you can have types of types of types
01:50 <lyxia> kinds become sorts
01:50 <centril> (Universe sets in Agda)
01:51 <centril> c_wraith: interesting: https://en.wikipedia.org/wiki/Girard%27s_paradox
01:51 <c_wraith> my question was more.. if they no longer behave differently, do we still call them something else?
01:53 <centril> c_wraith: well... TypeInType makes * :: * , which is an analog to Russel's Paradox... so you can prove bottom thus
01:53 <Tuplanolla> It's not `KindInType`, is it now?
01:54 defaultnick_ joined
01:54 <centril> Tuplanolla: call it what you want... but: * :: * is inconsistent as a logic
01:54 <centril> but haskell was already inconsistent as a logic, so that is fine
01:55 pleax joined
01:55 sanitypassing joined
01:58 Levex joined
01:59 theDon joined
01:59 <lyxia> c_wraith: It can still be useful and improve clarity to have a richer vocabulary when talking about a type and its own type.
01:59 <centril> lyxia: +1
02:02 <c_wraith> centril, haskell was already an inconsistent logic, so it's not like it's worse.
02:03 <centril> c_wraith: I already stated that ;)
02:04 gugah joined
02:05 patbecich joined
02:06 Ted___ joined
02:07 jsgrant-_ joined
02:07 yfeldblum joined
02:07 arawack joined
02:07 michael4 joined
02:08 flurp joined
02:08 oisdk_ joined
02:10 takle joined
02:13 <centril> hmm.. when using one signature for multiple functions like: a, b, c :: MyType ... can you specify haddok docs on the definitions of the functions ?
02:14 <lyxia> nope
02:14 <centril> damn
02:14 <centril> that sucks
02:15 ddere joined
02:17 takle joined
02:17 <lyxia> If you try you'll just duplicate the text
02:23 jessicah joined
02:24 mdtusz joined
02:28 mdtusz joined
02:30 sobaken joined
02:31 jedws joined
02:32 jsgrant-__ joined
02:35 mwilly joined
02:35 jedws joined
02:35 Jacoby6000_ joined
02:37 conal joined
02:39 defaultnick___ joined
02:40 FreeBird_ joined
02:40 takle joined
02:44 Rotaerk joined
02:44 <nshepperd> c_wraith: yeah I'm not really sure. I definitely still think about the 'kind of a type'. But not so sure if I should be distinguishing between 'Bool the type' and 'Bool the kind'
02:45 <nshepperd> is Bool inhabited by three values and two types? *head explodes*
02:46 wtetzner joined
02:47 <nshepperd> (or is that three types, if UndecidableInstances lets ⊥ be a type as well?)
02:50 drostie joined
02:52 ramzifu joined
02:52 dan_f_ joined
02:53 sellout- joined
02:54 Fairy joined
02:55 bigos joined
02:55 TxmszLou joined
02:56 <Rotaerk> hmm I don't actually know what I'm talking about, but it seems like it would be ... cleaner... to say that the Bool type only has two values, but the type of every expression is actually the union of the type you specify and the set containing ⊥
02:56 pleax joined
02:56 <Guest75574> anyone have any recommendations for config libraries?
02:59 <lyxia> Rotaerk: what about Maybe Bool :)
02:59 atian left
02:59 watabou joined
02:59 <Rotaerk> hmm true, I guess Just ⊥ is a possibility...
02:59 <lyxia> le_frogballs: what do you mean by config library
03:00 xtreak joined
03:00 hucksy joined
03:00 <le_frogballs> to read .conf files preferably...for static parameters
03:01 defaultnick___ joined
03:01 Ultifest2 joined
03:02 <lyxia> le_frogballs: I'm not sure about ways to read files, but once you've got a concrete configuration there are a couple of ways of threading it throughout your program discussed here https://www.reddit.com/r/haskell/comments/5xqozf/implicit_parameters_vs_reflection/?utm_name=haskell
03:02 <lyxia> Basically Reader/reflection/ImplicitParams
03:03 takle joined
03:03 shafox joined
03:05 afarmer joined
03:06 coltfred_ joined
03:07 fabianhu joined
03:08 certainty joined
03:08 yfeldblum joined
03:08 DonComo joined
03:09 sh0rug0ru joined
03:09 minn joined
03:09 markasoftware joined
03:12 cdg joined
03:14 sobaken joined
03:15 jokester joined
03:15 glamas joined
03:18 defaultnick___ joined
03:18 cschneid_ joined
03:19 _sras_ joined
03:21 vektorweg1 joined
03:22 takle joined
03:23 raycoll joined
03:28 JPisaBrony joined
03:29 FjordPrefect joined
03:29 steeze joined
03:30 defaultnick___ joined
03:31 Goplat joined
03:32 connrs joined
03:34 vektorweg11 joined
03:35 jsgrant-__ joined
03:36 enitiz joined
03:36 cdg_ joined
03:36 takle joined
03:36 tommd joined
03:37 <_sras_> Is there a library that can pretty print records without any additonal boilerplate?
03:38 jessekempf1 joined
03:39 le_frogballs joined
03:39 defaultnick___ joined
03:39 cdg joined
03:39 whaletechno joined
03:41 cdg joined
03:41 mda1 joined
03:42 nocookies92 joined
03:42 <lyxia> _sras_: is Show not pretty enough
03:43 takle joined
03:44 jsgrant-___ joined
03:45 defaultnick_ joined
03:47 <_sras_> lyxia: It is hard to read the output of show in case of nested records
03:49 <Koterpillar> pretty-show?
03:50 sword865 joined
03:50 connrs joined
03:50 brynedwa1ds joined
03:51 defaultnick_ joined
03:51 <_sras_> Koterpillar: for pretty-show, one has to convert the records to a format that this library understands, right?
03:51 <Koterpillar> hmm, there's no Generic?
03:51 cdg joined
03:52 <Koterpillar> ppShow :: Show a => a -> String
03:52 <Koterpillar> that seems good enough to me
03:52 mizu_no_oto joined
03:52 <Koterpillar> hmm, reading further
03:53 <Koterpillar> I would have thought they require GHC.Generic, but they don't. YMMV.
03:54 takle joined
03:56 <_sras_> Koterpillar: It's output is same as that of Show.
03:57 <Koterpillar> even for tuples and other instances of their PrettyVal?
03:58 louispan joined
03:58 pleax joined
03:58 exferenceBot joined
03:58 danthemyth joined
04:00 HEGX64 joined
04:02 lspitzner joined
04:03 hexagoxel joined
04:04 Swizec joined
04:04 piyush-kurur left
04:06 takle joined
04:07 mdtusz joined
04:09 bernouli joined
04:09 yfeldblum joined
04:10 alx741 joined
04:11 xall_ joined
04:11 Swizec joined
04:13 halogenandtoast joined
04:18 otto_s_ joined
04:18 takle joined
04:19 AfC joined
04:21 deepfire joined
04:21 kanishka joined
04:23 bamartindev joined
04:26 gcross_ joined
04:26 Jacoby6000_ joined
04:27 sobaken_ joined
04:27 jsgrant-___ left
04:29 zariuq joined
04:29 jsgrant-___ joined
04:30 defaultnick_ joined
04:31 louispan joined
04:31 zariuq joined
04:32 buttons840 joined
04:34 zar joined
04:35 takle joined
04:35 raycoll joined
04:36 xtreak joined
04:36 tono joined
04:38 jsgrant- joined
04:39 defaultnick_ joined
04:41 nathanic joined
04:41 le_frogballs joined
04:42 jmcarthur joined
04:43 nshepperd joined
04:43 pavonia joined
04:44 takle joined
04:45 andyhuzhill joined
04:45 defaultnick_ joined
04:46 piyush-kurur joined
04:46 <piyush-kurur> tommd: ping
04:50 castlelore joined
04:50 castlelore joined
04:50 andyhuzhill joined
04:51 <Wizek> Anyone knows what the following error means? Is my idea (as written in the issue) accurate? https://github.com/reflex-frp/reflex-platform/issues/103
04:52 steeze joined
04:52 <buttons840> any suggestions for HTML/CSS templating in haskell?
04:52 <buttons840> i've been looking at lucid, but don't know how to do CSS with it
04:57 afarmer joined
05:00 danthemyth joined
05:00 falafel joined
05:00 eklavya joined
05:01 pleax joined
05:06 Xanather joined
05:06 Rainb joined
05:10 yfeldblum joined
05:11 takle joined
05:11 pasukon joined
05:13 xcmw joined
05:15 FreeBirdLjj joined
05:16 nurupo joined
05:18 djellemah joined
05:18 takle joined
05:19 cris_ joined
05:21 defaultnick___ joined
05:21 minn joined
05:22 eklavya_ joined
05:22 Chobbes joined
05:22 chirpsalot joined
05:30 nomotif joined
05:32 ramzifu joined
05:33 emmanuel_erc joined
05:36 takle joined
05:38 certainty joined
05:38 hexagoxel joined
05:39 zbs joined
05:39 Edith joined
05:39 begriffs joined
05:41 bigos joined
05:42 cschneid_ joined
05:43 nathanic joined
05:43 sobaken joined
05:44 c0ncise joined
05:45 defaultnick joined
05:45 Swizec joined
05:46 [scrooge] joined
05:46 Bimos joined
05:48 Cale joined
05:52 cur8or joined
05:52 <dmj`> buttons840:
05:52 louispan joined
05:52 <dmj`> lucid is moreso for html
05:53 <dmj`> @package clay
05:53 <lambdabot> http://hackage.haskell.org/package/clay
05:54 <dmj`> ^ buttons840
05:55 osa1 joined
06:00 pantsman_ joined
06:00 danthemyth joined
06:01 humboldt joined
06:02 pleax joined
06:02 hexagoxel joined
06:04 dec0n joined
06:04 takle joined
06:07 _sg joined
06:07 <tommd> piyush-kurur: pong
06:07 <buttons840> dmj`: would you use clay with lucid then?
06:08 <buttons840> in other words? use both?
06:09 defaultnick_ joined
06:10 <liste> buttons840: yes
06:10 <liste> lucid for html, clay for css
06:11 harfangk joined
06:11 FreeBirdLjj joined
06:11 <piyush-kurur> tommd: it was just regarding the issue for file specific cc-flags
06:12 <piyush-kurur> I just forked cabal repository and am putting up a small proposal
06:12 <dmj`> buttons840: you won’t be able to write css in javascript generated by haskell
06:12 takle joined
06:13 <dmj`> buttons840: unless you made ffi bindings to create and manipulate styles with the dom
06:13 path[l] joined
06:13 <buttons840> i am just making static pages
06:13 <dmj`> buttons840: you can write the css clay generates to disk to a static dir that the web server servers
06:13 iomonad joined
06:14 zar joined
06:15 <buttons840> dmj`: i don't want to write to disk, I need what would traditionally be called "templates" for a CRUD app
06:16 <dmj`> buttons840: you can render the Clay type to a Bytestring and embed that into the lucid template
06:16 <dmj`> I don’t recommend inline styles
06:17 <buttons840> dmj`: oh, i got confused and thought you mean write the HTML to disk -- yeah, I agree I should write the CSS to disk
06:17 FreeBirdLjj joined
06:17 slomo joined
06:17 slomo joined
06:17 <buttons840> i'll probably just inline a hand written CSS file to begin with, i'm already taking on a lot of new ideas here
06:18 defaultnick joined
06:19 <osa1> what breaks if I define Eq and Ord instances so that `compre x y /= EQ` but `x == y` ?
06:20 <osa1> for some reason I always assumed Eq and Ord should be in agreement about when two values are equal but looking at the docs that doesn't seem to be the case
06:20 systemfault joined
06:22 zar joined
06:23 <piyush-kurur> tommd: I have just added a comment to the issue https://github.com/haskell/cabal/issues/4294
06:23 takle joined
06:23 <piyush-kurur> just let me know how it looks
06:24 <Axman6> osa1: nothing happens, but code will break. I think that is probably a law for Ord, but there's nothing which (can) enforce it
06:24 <kadoban> osa1: Sounds quite confusing for any users of those instances, at least.
06:24 <buttons840> :i Ord
06:24 <osa1> no that's not a law, that's what I'm saying
06:24 FreeBirdLjj joined
06:25 <ezyang> piyush-kurur: I'm not a big fan of cc-options-for: filename flag flag
06:25 <ezyang> it's weirdly asymmetric
06:26 FreeBirdLjj joined
06:26 mbuf joined
06:26 <ezyang> Other thing to watch out for: if you add a Cabal feature for this, you are committing your packages to requiring a sufficiently new version of Cabal to build correctly
06:26 daddy_chevere joined
06:27 <ezyang> If you've got a support window, like many packages do, you'll need a BC story too
06:27 xtreak joined
06:27 defaultnick_ joined
06:27 henriksod joined
06:28 louispan joined
06:28 <piyush-kurur> ezyang: what are the other options
06:28 daddychevere joined
06:28 FreeBirdLjj joined
06:28 <ezyang> piyush-kurur: I did say that I couldn't think of a good syntax ;)
06:29 <ezyang> otoh, filename flag flag might not be so terrible
06:29 <piyush-kurur> ezyang: you mean in the c-sources ?
06:30 daddychevere joined
06:30 <ezyang> cc-options-for
06:30 Wizek_ joined
06:31 <piyush-kurur> ezyang: sorry I am confused, you first said you do not like c-options-for
06:31 <ezyang> Yes I did
06:31 raycoll joined
06:31 <ezyang> but I also agree that there aren't very many good choices for syntax
06:31 <tommd> I'll think on it some.
06:32 <ezyang> Setting that aside for now, what about the BC problem?
06:32 <piyush-kurur> ezyang: that is simple for older cabals we do not give the user the best options ;-)
06:32 FreeBird_ joined
06:33 <ezyang> ok. That's a design constraint, because it means any option you add, needs to be ignored by old cabal
06:33 <piyush-kurur> just whatever is currently supported
06:33 defaultnick___ joined
06:33 <ezyang> I don't actually remember what happens when Cabal sees a field it doesn't undersatnd
06:33 <piyush-kurur> ezyang: okey now I see what you meant
06:33 <piyush-kurur> sorry I was being dense
06:33 <tommd> piyush-kurur: How would this help the avx2 issue where you want portability on non-avx systems as well?
06:33 <ezyang> np
06:34 <ezyang> tommd: Seems like this won't really help
06:34 <ezyang> because Cabal doesn't know about avx
06:34 FreeBirdLjj joined
06:34 <tommd> piyush-kurur: I suppose something like `cc-options-for: x.c -mavx -DWITH_AVX` newline `x.c // notice no avx`.
06:34 takle joined
06:34 <piyush-kurur> tommd: yes something like that
06:34 <tommd> piyush-kurur: But cabal would need to know to produce and link to seperate object files from one (duplicately mentioned) C file.
06:34 Jacoby6000_ joined
06:35 FreeBird_ joined
06:35 <tommd> And that's some careful CPP to boot.
06:35 calincru joined
06:35 <tommd> Anyways, It's late by my standards so I'm signing off. Thanks for putting this together piyush-kurur, I'll mull it over.
06:36 <piyush-kurur> tommd: if I link a file that contains some avx code and do not call that function on a non-avx machine it should be fine I guess
06:36 <piyush-kurur> tommd: bye
06:37 zar joined
06:37 <piyush-kurur> I will choose to call the function that contains the avx2 code from the haskell level. There is no harm in it residing in the .so file and not being called I guess (some what like a fat binary)
06:38 TxmszLou joined
06:38 Micamo joined
06:38 FreeBird_ joined
06:40 calincru joined
06:42 <piyush-kurur> ezyang: is it necessary that we need all the options in cabal file. It might make sense to have a helper file for tweaking cc-options
06:42 daddychevere joined
06:42 pleax joined
06:43 <ezyang> Helper file would be major architectural change
06:43 <ezyang> Would be better to do a Custom setup in that case :/
06:45 <piyush-kurur> ezyang: that is what I meant, we provide hooks that users can include in their setup.lhs which does a c flags matching
06:45 ThomasLocke joined
06:45 ThomasLocke joined
06:46 <Squarism> i have a parameterized type that takes 2 type arguments. Thing is its really a pair of type arguments. They cannot be varied separatly. So i wonder if theres some trick to make "MyType a b" into "MyType c"
06:46 <Athas> Squarism: type families.
06:46 <Athas> But it's a heavy hammer.
06:46 <Cale> You might be able to define a type family which determines one from the other
06:46 <Cale> yeah
06:47 patbecich joined
06:47 <ezyang> piyush-kurur: Yes, that's doable
06:47 <Cale> Or depending on the situation, a class with a functional dependency might also be useful
06:47 <Squarism> heavy hammer? I havent learned that expression
06:47 <Cale> I wouldn't consider it all that heavy, unless you're concerned about using compilers which aren't GHC
06:48 JoshS joined
06:49 <piyush-kurur> ezyang: just confirm one thing. It should be possible for me to have say a function bar in foo.c which is compiled with say -mavx2 and added in the .so file.
06:49 <piyush-kurur> on platforms that do not have avx2 we will just not call it (decision done at the Haskell level)
06:49 arawack joined
06:50 platz joined
06:50 <Squarism> From google search i found https://wiki.haskell.org/GHC/Type_families. All code examples squeezed inbetween explaination into unreadable. Could have been better! =D
06:51 <ezyang> Not easily
06:51 <ezyang> We do know what arch you're building with
06:51 defaultnick___ joined
06:51 <ezyang> but we don't have any feature tests for things like avx support
06:51 <ezyang> that sort of thing is usually done with a Configure script
06:52 <ezyang> The way this works is you run the Configure script, this generates a buildinfo which is then "added" to the Cabal package description, for flags and stuff
06:52 <ezyang> Actually, now that I think of it, I'm not convinced that this wouldn't solve your problem!
06:52 laz joined
06:53 <piyush-kurur> ezyang: I would want the code to be compiled in any case because often the machine where the code is run will be different from the machine where it s executed
06:53 connrs joined
06:53 takle joined
06:54 <ezyang> "If only gcc had {-# GCC_OPTIONS ... #-}"
06:54 <ezyang> ;)
06:54 defaultnick_ joined
06:54 <piyush-kurur> ezyang: that is not enough
06:54 <piyush-kurur> often you have the following situation. Debian package builder builds on say a machine without avx2
06:55 <piyush-kurur> but it is to be run on a machine with avx2
06:55 <piyush-kurur> one needs something like a fat binary
06:55 <ezyang> piyush-kurur: Put this in the ticket!
06:55 caumeslasal joined
06:56 bjz joined
06:56 <piyush-kurur> ezyang: it is there in the ticket that is referred to but yes I will add this point
06:57 patbecich joined
06:58 <ongy> piyush-kurur: I don't know the exact details, but I do know that we do that somewhere in a C library. But I think there's some trick with compiler intrinsics
06:58 <ongy> you can get an array of supported extensions form the CPU in *some* way
06:58 sideir joined
06:58 <piyush-kurur> ongy: cpuid ?
06:59 <ongy> possible, I have only read a bit of backlog, so if you got a reason not to use it, I probably missed it
06:59 eacameron joined
06:59 insitu joined
07:00 <piyush-kurur> ongy: we were discussing the following ticket for cabal https://github.com/haskell/cabal/issues/4294
07:01 takle joined
07:01 <ski> Squarism : there is an iso between `T * T' and `2 -> T' which could be used .. in your case, one could have `MyType :: (Tag -> *) -> *' -- but possibly it's too heavy-weight / inflexible for your use case
07:03 <ongy> ah, that explains the problem
07:03 defaultnick___ joined
07:04 <Squarism> ski, Thanks but thats greek to me.
07:06 <piyush-kurur> ezyang: I have added a comment on the build machine being different from the target machine
07:07 raichoo joined
07:07 <piyush-kurur> ongy: If you have better ideas please pitch in.
07:07 travula joined
07:07 <ezyang> thanks
07:07 Ch3ck joined
07:09 <winny> https://en.wikipedia.org/wiki/Wilmington_insurrection_of_1898
07:09 <winny> oops wrong channel
07:09 <ongy> not really. http://stackoverflow.com/questions/12925989/gcc-enable-compiler-flags-only-on-specific-functions could work for some cases
07:09 andrevdm joined
07:10 <piyush-kurur> ongy: that looks like it should solve many of my use cases thanks
07:10 ner0x652 joined
07:10 <ongy> but I think this should be done by the build system. Or have cabal invoke make for the more complex cases? Adding foreing build capabilities to cabal will only go so far
07:10 <piyush-kurur> ezyang: just have a look at the url that ongy pointed out
07:11 fizruk joined
07:11 <ezyang> oh that's nice
07:11 <ezyang> can you use that instead?
07:12 <piyush-kurur> ezyang: I think a lot of problems will be handled by it I guess.
07:12 <piyush-kurur> I will add the link to the ticket
07:13 Sose joined
07:14 <piyush-kurur> ongy: your github id (for reference in the ticket)
07:14 <* ongy> is ongy on github :)
07:14 takle joined
07:15 <ongy> ezyang: does cabal use the CC env var? or does it decide on the compiler in some other way?
07:15 <ski> Squarism : one way of making a "pair" of types `A' and `B' is to define `data Tag = IsA | IsB' and then the "pair type" is `data AB :: Tag -> * where FromA :: A -> AB IsA; From B :: B -> AB IsB'. to pass this "pair" of `A' and `B' to `MyType', use `MyType AB'. to access the two components of `ab' in `MyType ab', use `ab IsA' and `ab IsB'
07:16 <ezyang> --with-gcc and --gcc-options, I think
07:18 xcmw joined
07:18 defaultnick___ joined
07:18 path[l] joined
07:19 castlelore joined
07:19 castlelore joined
07:19 <Squarism> ski, that was a concrete explaination. Thanks!
07:19 certainty joined
07:19 hdeshev joined
07:21 <ski> Squarism : as i said, this is pretty heavy-weight (in that you have to define a new type `AB' (and `Tag' needs to be defined)) / inflexible (hard to vary `A' and `B') .. but this encoding can sometimes be useful (e.g. when making several mutually recursive types (usually ASTs), where you want to untangle the recursion for `Fix'-trick purposes)
07:22 connrs joined
07:22 <Squarism> ski, so would you recommend that approach over type famillies?
07:24 zar joined
07:25 amy_ joined
07:26 <ski> i'm not quite sure how the type family thing is supposed to go here
07:26 CIKIDING joined
07:26 <CIKIDING> hallo
07:26 della joined
07:26 <amy_> bored :(
07:26 luigi joined
07:26 <liste> hello CIKIDING
07:27 <amy_> hi @luigi
07:27 <amy_> pls talk to me?
07:27 <andrevdm> Hi all. Am I correctly understanding that a record defined with newtype means that all the records fields are all automatically strict? That seems to be what the docs say
07:27 nshepperd joined
07:27 <luigi> @okay
07:27 <lambdabot> Unknown command, try @list
07:27 <Guest21874> talk to me too
07:28 <jle`> andrevdm: should be, yes
07:28 <jle`> depending on what you are thinking about when you mean strict
07:28 <liste> @let newtype Foo = Foo { bar :: String, baz :: String } -- andrevdm
07:28 <lambdabot> Parse failed: newtype declaration constructor must have exactly one parameter.
07:28 <luigi> haiiii @amy
07:29 <jle`> newtype Identity a = Identity a
07:29 <jle`> newtype Identity a = Identity { runIdentity :: a }
07:29 takuan joined
07:29 <jle`> the two should have the same strictness semantics
07:29 Guest21874 left
07:29 <andrevdm> so more or less data A = A {a :: !Int} == newtype A = A {a::Int}
07:29 <jle`> all the record gives you is an accessor and constructor
07:29 <jle`> well, the record-ness is a bit of a distraction here
07:29 supriyadi joined
07:29 <andrevdm> (ignoring the fact that newtype is removed at compile time)
07:30 <amy_> how do i do a private chat?
07:30 <jle`> data A = A { a :: !Int } has the same strictness as data A = A !a
07:30 <jle`> er, A !Int
07:30 <jle`> so the records don't have anything to do with it
07:30 <liste> amy_: type /msg <nick>
07:30 <jle`> are you asking if `data A = A !Int` is the same as `newtype A = A Int` ?
07:31 zeroed joined
07:31 zeroed joined
07:31 <luigi> kikuk2x test
07:31 cur8or joined
07:31 <ski> andrevdm : well, with `data', `case _|_ of A _ -> ()' doesn't terminate; but with `newtype', it would
07:31 <andrevdm> hmm, we specifically I asking about records :) because I've got a bunch of records defined with data (all fields strict) and I'm thinking I should make them newtypes
07:31 <andrevdm> and I want to understand if that is chaning my strictness
07:31 <amy_> help
07:32 <andrevdm> *chaning
07:32 <ski> amy_ : do you have a Haskell-related query ?
07:32 <liste> andrevdm: so you have records with multiple fields?
07:32 <andrevdm> @liste correct, yes multiple
07:32 <lambdabot> No module "correct, yes multiple" loaded
07:32 <luigi> @liste kikuk2x
07:32 <lambdabot> No module "kikuk2x" loaded
07:33 <liste> andrevdm: newtypes can only have one field
07:33 <CIKIDING> @luigi pak tito yg punya punya polisi banyak
07:33 <lambdabot> Unknown command, try @list
07:33 <andrevdm> but that one field can be a record?
07:33 <ChanServ> glguy quieted *!*@*/ip.
07:33 <andrevdm> ah, no
07:34 <jle`> the single field of a newtype can be a record
07:34 <andrevdm> ok, I see where it all went wrong
07:34 <jle`> most of the newtypes in 'base' actually are records :o
07:34 alfredo joined
07:34 srbaker_ joined
07:34 <andrevdm> thanks, yes. Ok, that then makes a lot more sense
07:34 <jle`> but for the most parts records are just synactic conveniences
07:34 <andrevdm> I was misreading the hlint suggestion, I thought it was on a multi-record field
07:34 <jle`> they don't affect any strictness properties
07:34 <nshepperd> sometimes people talk of making a newtype wrapping a tuple, but that is redundant. if you have multiple things you want to wrap, you're better of with some kind of 'data'
07:35 <andrevdm> excellent, thanks.
07:35 <ski> nshepperd, usually
07:35 pleax joined
07:36 path[l] joined
07:36 jutaro joined
07:36 <ongy> I found some old code from when I was new-ish to haskell... one of the oddities I found in there was exactly that
07:37 <andrevdm> ski: I missed the comment about bottom. Thanks, I see that in the wiki, I'll read that again (a few times) to make sure I understand
07:41 Edith joined
07:42 magthe joined
07:42 ragepandemic joined
07:43 Jacoby6000_ joined
07:46 FreeBirdLjj joined
07:47 unK_ joined
07:48 defaultnick_ joined
07:48 Swizec joined
07:48 certainty joined
07:50 takle joined
07:51 zeroed joined
07:52 raichoo joined
07:53 mikecaruso joined
07:54 HEGX64 joined
07:54 rixile joined
07:54 defaultnick_ joined
07:54 newbie84 joined
07:55 newbie88 joined
07:55 Adeon_ joined
07:55 FreeBirdLjj joined
07:55 byte512 joined
07:55 RayNbow`TU joined
07:56 mwsb joined
07:57 zomg_ joined
07:57 <lolisa> Hi
07:57 so joined
07:57 nikolah joined
07:57 mounty joined
07:58 patbecich joined
07:58 <liste> hi
07:58 <lolisa> So I am reading the algebra of programming.
07:58 takle joined
07:58 tinkyholloway joined
07:59 darthdeus_ joined
07:59 liyang joined
07:59 CoconutCrab joined
07:59 ziman joined
07:59 <lolisa> I had gone to f-algebra, and it is going sort of quite well. The only problem is, I 'get' the commutative diagram prove much faster than the 'traditional' equational reasoning style proof that I generate alongside in my head.
07:59 connrs joined
08:00 <lolisa> so should I learn to forget about my old intuition and just do commutative diagram?
08:00 <ski> how is that a problem ?
08:00 <ski> perhaps learn to more easily translate between the two ?
08:01 <lolisa> Yes, those two are options to choose from, and I dont know if keeping the old is useful or not.
08:01 Reisen joined
08:02 <ezyang> nothing wrong with commutative diagrams
08:02 <ski> i don't think the commutative diagram approach itself handles expressing the logic surrounding equations between compositions that well
08:02 Ulrar joined
08:03 rejuvyesh joined
08:04 <* ski> raises eyebrow
08:04 <ski> iirc Freyd and Scedrov used a marker in a polygon to express that the corresponding equation didn't have to hold. then they could e.g. have implications between diagrams involving the same objects and morphisms, though the latter diagram could involve some more as well
08:05 Jicoss joined
08:05 Iskarlar joined
08:06 edsko joined
08:06 hazmat__ joined
08:08 nick_h joined
08:09 takle joined
08:09 jathan joined
08:09 rgr joined
08:09 hexagoxel joined
08:11 rgc joined
08:12 ragepandemic joined
08:12 guiben joined
08:14 andyhuzhill joined
08:14 eklavya joined
08:15 bjz joined
08:16 ali_bush joined
08:16 ali_bush joined
08:16 biglama joined
08:18 xinming_ joined
08:19 takle joined
08:20 thc202 joined
08:21 albertid joined
08:21 FreeBird_ joined
08:22 connrs joined
08:22 TheEpsylon- joined
08:23 FreeBir__ joined
08:24 watabou joined
08:24 albertid joined
08:25 Maerten joined
08:26 jhrcek joined
08:26 Jicoss joined
08:26 mda1 joined
08:28 cschneid_ joined
08:28 louispan joined
08:28 [scrooge] joined
08:29 jmorris joined
08:30 quchen joined
08:32 FreeBirdLjj joined
08:33 cinimod joined
08:33 defaultnick joined
08:34 sidei_ joined
08:34 fre2 joined
08:37 insitu joined
08:37 Thra11 joined
08:37 V3 joined
08:39 defaultnick joined
08:39 magneticduck joined
08:42 Miroboru joined
08:43 ipuustin joined
08:43 connrs joined
08:43 xall_ joined
08:45 defaultnick___ joined
08:46 <osa1> exporting lenses for a type individually is too much work. that's not possible to do with some TH magic, right?
08:46 <jle`> osa1: that's what "classy" lenses are for
08:47 <jle`> osa1: it defines lenses for a type as instances of a new typeclass
08:47 <jle`> so you just export the typeclass(..)
08:47 <jle`> s/instances/methods
08:47 <osa1> jle`: which package does that?
08:48 BartAdv joined
08:48 <jle`> osa1: http://hackage.haskell.org/package/lens-4.15.1/docs/Control-Lens-TH.html#v:makeClassy
08:48 <jle`> it's in the lens package
08:48 takle joined
08:48 merijn joined
08:48 <jle`> instead of writing `makeLenses`, just write `makeClassy`
08:48 FreeBirdLjj joined
08:48 <jle`> they're both exported from the same module
08:49 marfoldi joined
08:49 CurryWurst_ joined
08:49 bollu joined
08:51 <osa1> hmm defining a typeclass and an instance just for exporting purposes doesn't sound nice.
08:51 <osa1> it'll also make the error messages worse if I use a lens with imcompatible type
08:51 <osa1> e.g. lens for X with Y
08:51 CurryWurst_ joined
08:51 zar joined
08:52 ramzifu joined
08:53 zeroed joined
08:53 tsmish joined
08:54 <osa1> I know I'll end up using that though :-) thanks jle`
08:54 <jle`> no problem! and yeah i always felt it was more of a hack than anything
08:54 Mortomes|Work joined
08:55 <magthe> An emacs question: when adding a package to a .cabal file I sometimes get a completion suggestion and if I then press <RET> I get a lower bound for the version... is there some way to control this behaviour (I'd relly like to get an upper bound too)?
08:55 <magthe> Oh, should probably mention that I'm using spacemacs, with intero
08:58 danza joined
08:59 patbecich joined
09:00 pleax joined
09:02 plutoniix joined
09:03 kritzcreek_ joined
09:03 zero_byte joined
09:04 aklrcv joined
09:05 Thra11_ joined
09:06 srbaker_ joined
09:09 orbifx joined
09:10 mmn80 joined
09:10 yezariaely joined
09:14 SpinTensor joined
09:15 tomphp joined
09:17 baldrick joined
09:17 certainty joined
09:17 mohsen_ joined
09:19 nemorichard joined
09:20 xcmw joined
09:20 bezirg joined
09:21 igniting joined
09:21 fizruk joined
09:22 freusque joined
09:23 insitu joined
09:23 yogsototh joined
09:24 ramzifu joined
09:24 defaultnick joined
09:24 rgr joined
09:25 Bish joined
09:25 nomotif joined
09:25 watabou joined
09:26 spaceships joined
09:27 Miroboru joined
09:28 cinimod` joined
09:30 glguy joined
09:30 defaultnick joined
09:30 Levex joined
09:30 RevJohnnyHealey joined
09:30 nemorichard joined
09:30 Miroboru joined
09:35 le_frogballs joined
09:36 xtreak joined
09:37 defaultnick joined
09:37 _sg joined
09:39 foobars joined
09:39 defaultnick joined
09:40 lithie joined
09:40 Rotaerk joined
09:40 IanKelling joined
09:41 oisdk joined
09:42 mohsen_ joined
09:42 jutaro joined
09:43 oisdk joined
09:43 orion joined
09:46 defaultnick___ joined
09:49 rixile joined
09:51 jaspervdj joined
09:51 eacameron joined
09:52 <Squarism> Here, what does it mean if a construtor parameter has "!" infront of it like here : https://hackage.haskell.org/package/aeson-,
09:52 nemorichard joined
09:52 <sbrg> That it's strict
09:52 <sbrg> See the BangPatterns extension
09:52 <Squarism> ok thanks
09:53 Jacoby6000_ joined
09:54 defaultnick joined
09:55 slomo joined
09:55 <geekosaur> that's not BangPatterns though, it's core Haskell
09:55 slomo joined
09:56 permagreen joined
09:56 <Akii> not anymore maybe https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_guide/bang-patterns.html
09:57 <geekosaur> but in any case it means any time a value is constructed, that field's value will have seq applied to it so it has been evaluated to the first constructor. (this does not guarantee full strictness, except for "atomic" types like Int)
09:57 <merijn> Akii: Hasn't been an extension in years, if ever
09:57 <geekosaur> no, BangPattgerns is for use in patterns. use in data constructors is Haskell98
09:57 Thra11_ joined
09:57 <merijn> Akii: bang patterns is about *patterns*, not constructors
09:57 <merijn> Hence, the name
09:57 <Akii> merijn: got confused about -XBangPatterns; I only know that from lang extensions
09:59 <Akii> so, I also see this bang pattern being used occasionally; when should I use it?
10:00 <geekosaur> most common use is when you are deconstructing/pattern matching with let; case and top-level pattern bindings are strict by default
10:00 fizruk joined
10:00 <geekosaur> but let is lazy by default (except, iirc, if you have MonoLocalBinds enabled)
10:00 defaultnick___ joined
10:00 patbecich joined
10:01 arcanine joined
10:01 dramforever joined
10:01 <Akii> geekosaur: and with data constructors?
10:01 <geekosaur> hm, either I am misremembering that or it's a related extension
10:02 <geekosaur> data constructors are a different issue, any time you build a value with that constructor it will be lazy unless the declaration included a bang on the type
10:02 <geekosaur> this is not related to pattern matching: even if you match a value of that type, it's something that already exists so no constructor behavior would be applied to it
10:03 <Akii> so `data Foo = Int String` will have `Foo thunk thunk`?
10:03 <geekosaur> errrr
10:03 <geekosaur> I assume you meant data Foo = Foo Int String, otherwise the value is Int thunk
10:03 <Akii> ah yes, sorry
10:03 takle joined
10:03 defaultnick joined
10:03 <geekosaur> (remember type and data constructors are in separate namespaces)
10:03 danthemyth joined
10:04 <Akii> and with `data Foo = Foo !Int !String` it would evaluate directly
10:04 <Akii> (yes, I know; just typo :D)
10:04 <Akii> that's very interesting
10:05 <Akii> for me that means: if I produce a lot or if I definitely need those values when constructing a data type, I use strict evaluation
10:05 nemorichard joined
10:05 <geekosaur> it depends on usage
10:05 jmorris joined
10:05 <geekosaur> if it is often part of a computation that would otherwise end up being discarded much of the time, strictness will cause slowdowns
10:06 defaultnick joined
10:06 sid_fules joined
10:06 <Akii> I don't understant
10:06 <Akii> understand* xD
10:07 takle_ joined
10:07 <Akii> what's the slowdown; discarding the thunk vs discarding the value?
10:07 swalladge joined
10:07 <Akii> ah yes sorry
10:07 <Akii> "strictness will cause slowdowns"
10:07 <Akii> somehow read laziness >.<
10:07 <Akii> of course ^^
10:07 <geekosaur> the thunk ends up part of a value you never reach because something else is doing a take 3 that never reaches it, or something
10:07 fizruk joined
10:08 <geekosaur> so you forced a value to no point
10:08 Gurkenglas_ joined
10:08 sid_fules joined
10:08 <Akii> generating thunks just uses up more memory then?
10:09 <geekosaur> thunks are usually cheap, it's forcing values that is expensive. but it depends on what you do with them, as usual
10:09 <Akii> well I had one case where I ended up with 4 GB of thunks
10:09 <geekosaur> which is why you really need to profile and not just sprinkle bangs on stuff liek salt
10:09 <Akii> that was fun
10:09 <Akii> like salt bae xD
10:10 <Akii> okay, thanks!
10:10 <geekosaur> reasoning about where laziness helps and where it hurts is *hard*
10:10 phaji joined
10:11 <geekosaur> thunks can consume memory if they stack up in the pattern match stack. heap allocations can consume memory as well. (the foldr/foldl issue)
10:11 <geekosaur> one is from too much laziness, the other from being too strict
10:12 defaultnick___ joined
10:13 <geekosaur> and one of the strengths of haskell is laziness lets you specify work that won't be done if it's not needed (e.g. infinite lists) if that's the natural way to express something; strictness will hurt you in this case
10:13 <geekosaur> go the "must strict everything!" route and you end up writing Haskell-flavored C instead of Haskell
10:14 <geekosaur> because common Haskell idioms and even common Haskell library functions will choke if you are too strict
10:14 <Adeon> I also find non-strict semantics a readability benefit
10:14 <Akii> other than the one issue (where I expected nothing else) I never had any problems with laziness so far
10:15 <Akii> but good to keep in mind; some day I'll run into an issue :D
10:15 <Adeon> sometimes I can write expensive computations in a function with confidence none of that will be computed if it turns out they don't need to be
10:15 dramforever joined
10:17 Berra joined
10:18 neetrichard joined
10:20 mada joined
10:20 fendor joined
10:21 defaultnick_ joined
10:22 andrei_chifa joined
10:22 freusque joined
10:23 twanvl joined
10:23 oish joined
10:24 defaultnick joined
10:27 jmorris joined
10:27 watabou joined
10:27 Thra11_ joined
10:28 Aku joined
10:28 Nicnux joined
10:28 ub joined
10:28 ub_ joined
10:29 danvet joined
10:29 <Aku> Can anybody tell me the difference between newtype Parser a = Parser (String -> [(a,String)]) and type Parser a = String -> [(a,String)] ?
10:29 pleax joined
10:30 <ski> the former declares a new data type. the latter merely gives a synonym to an existing type
10:30 defaultnick joined
10:30 ccomb joined
10:30 <ski> the former could be made an instance of type classes like `Functor',`Applicative',`Monad'. the latter couldn't
10:31 <Aku> To declare a new data type we usually write data Colour = Red | Green
10:31 <ski> yes
10:31 <Aku> What's the difference?
10:31 <Aku> ski: ?
10:31 <ski> `newtype' is a special case of `data', that's handled slightly differently
10:31 <dramforever> Aku: newtype only makes a new type not new data
10:32 <Aku> dramforever: okay
10:32 <dramforever> It's best thought as a compile-time wrapper of another type
10:32 <ski> `newtype' is like `type' in that you can only "wrap" one type. also no multiple data constructors
10:32 <dramforever> compile-time only
10:32 freusque joined
10:32 <ski> but it's like `data' in that you have an explicit data constructor, to construct and deconstruct (pattern-match)
10:32 <Aku> ohhkay...
10:33 <Aku> ya right
10:33 <ski> since it's a new type, the "implementation/representation type" and the new type are considered distinct
10:33 phaji joined
10:33 tsmish joined
10:33 <Aku> ohhkay
10:34 bennofs1 joined
10:34 <ski> one can think of the data constructor of a `newtype' as only existing at compile-time, while at run-time a value of the representation type is passed around directly
10:34 <Maxdamantus> The only reason it's not just `data` afaik is its special handling of deconstruction.
10:34 <Aku> Thanks
10:34 <Maxdamantus> (that is, not just a special case of `data`)
10:34 <ski> this means that there's no difference between `Parser undefined' and `undefined' (there would be a difference with `data')
10:34 <Maxdamantus> Yeah, that.
10:35 <ski> also, matching on the pattern `Parser f' will not demand/force any evaluation
10:35 <Aku> hm...
10:36 <ski> you can probably ignore these finer points for now
10:36 <Aku> ya looks like, I need to read more!
10:38 <osa1> *sigh* I sometimes think typeclasses like ToJSON, FromField etc. are actually an anti-pattern. it's especially annoying when only typeclass versions of combinators are provided (e.g. (.:))
10:38 <osa1> most of the types don't have a canonical JSON, CSV field etc. representation
10:38 sarkin joined
10:39 <merijn> I really hate that people decided JSON was a reasonable format for serialising shit
10:39 <Akii> what's wrong with ToJSON?
10:39 <merijn> You can't even reliably store an integer in JSON unless you store it as a string, for christ's sake
10:40 <merijn> Akii: You mean "what's wrong with JSON?"
10:40 pickle_ joined
10:40 <osa1> Akii: like I said, there most types don't have canonical JSON representation
10:40 <osa1> but a type can have one instance of a typeclass
10:40 <merijn> I'm sure ToJSON is perfectly reasonable, if you are a priori okay with the idiocy that is JSON
10:40 bollu joined
10:41 <osa1> merijn: is it? I can implement many JSON representations of a type
10:41 <Akii> well Aeson does offer a data type representing JSON
10:41 <osa1> Akii: like I said, combinators like (.:) only have typeclass version. I can't provide a parser to (.:)
10:42 <Freundlich> osa1: But that's the case for most type classes anyway. Sometimes it's also quite annoying (like what should a monoid of natural numbers be?).
10:42 <osa1> so I have to implement a newtype
10:42 <osa1> Freundlich: agreed
10:42 <osa1> IMHO typeclasses should be used less, not more
10:42 <ski> "combinators like (.:) only have typeclass version" ?
10:43 <osa1> ski: `(.:) :: FromField a => NamedRecord -> ByteString -> Parser a` I need a version of this function that takes a `fromField` function
10:43 <* ski> 's never seen this before
10:43 <osa1> it's from cassava but similar functions exist in aeson too
10:44 <Akii> this? https://hackage.haskell.org/package/aeson-
10:44 <ski> (as opposed to `(.:) :: (c0 -> c1) -> (a -> b -> c0) -> (a -> b -> c1)')
10:44 oisdk joined
10:44 <Akii> this would allow you to write a parser for Value though, which is instance of FromJSON
10:44 <Akii> -would +does
10:45 sidei_ joined
10:45 defaultnick joined
10:45 <osa1> Akii: yeah like that function. I need a version of it that takes the parser as argument
10:48 defaultnick joined
10:52 certainty joined
10:53 Gurkenglas_ joined
10:53 danthemyth joined
10:54 t_h joined
10:54 silver joined
10:54 ccomb joined
10:56 bollu joined
10:57 travula joined
10:57 janos joined
11:00 humboldt joined
11:00 defaultnick___ joined
11:02 patbecich joined
11:02 egis joined
11:02 Jacoby6000_ joined
11:04 Levex joined
11:04 oish joined
11:05 dhil joined
11:06 oisdk joined
11:06 benl23 joined
11:06 coot joined
11:08 kuribas joined
11:08 <jle`> osa1: i've come to think that ToJSON/FromJSON is a better solution than offering serializers apart from the typeclasses
11:08 <jle`> because it enforces a canonical encoding
11:08 deepfire joined
11:08 <jle`> which is important for functions that are polymorphic over all JSON instances
11:08 xtreak joined
11:08 <jle`> kind of like for 'Data.Map' or 'Data.HashMap'
11:09 <osa1> those functions can still be polymorphic by getting a parser/serializer parameter instead!
11:09 defaultnick_ joined
11:09 <jle`> yes, if Data.Map was given a comparing function instead, then things would break
11:09 bjz_ joined
11:09 <osa1> things worse for CSV instances btw, because even the simplest types like Bool don't have a canonical representation
11:09 <jle`> because you have to guaruntee that *every* time someone uses a given Map, you have to use the same comparing function as the one it was created with
11:09 <osa1> jle`: not if you use the same function for insertion and lookup
11:10 <jle`> yes, you have to give the same function every time
11:10 <osa1> jle`: right. I'm willing to do that for CSV/JSON instances.
11:10 <jle`> so for JSON, you have to guaruntee that the same decoding parmaeter is used every time you work with it
11:10 <jle`> requiring people to pass it in at every single usage site is a sure-fire way to get a bug
11:10 moongazer joined
11:11 <osa1> at least provide both versions of functions then
11:11 <osa1> I don't want to maintain this mess of newtypes
11:11 <jle`> like if you required people to pass in a comparator function every time you used insert/lookup for Data.Map is a really really fast way to get corrupted maps
11:11 <jle`> hopelessly corrupted maps would be inevitable
11:12 <osa1> I'm not talking about Ord or Eq or maps
11:12 ggVGc joined
11:12 <jle`> it's the same situation here, though
11:12 <jle`> ~ the power of analogy ~
11:13 defaultnick_ joined
11:13 Guest37528 joined
11:14 ronnik joined
11:14 <jle`> especially talking about situations where you use multiple modules and multiple executables all working polymorphically with json instances, if you require people to pass in a parser every time, it's an easy way to get data corruption
11:14 <tdammers> IMO the most whopping advantage of ToJSON / FromJSON being typeclasses is that you can write generic instances for higher-kinded types without dragging explicit encoders along
11:14 <tdammers> pretty much exactly that
11:14 <osa1> jle`: it's not the same situation at all. I can have multiple JSON providers that use different formats for the same thing.
11:15 <tdammers> osa1: you can still do that, just not through ToJSON / FromJSON
11:15 pleax joined
11:15 <tdammers> osa1: but you can still provide alternative ser/der explicitly
11:15 <osa1> tdammers: not easily. I need newtypes
11:15 <tdammers> osa1: not if you bypass the JSON typeclasses
11:16 <osa1> it's still a lot harder. like I said above many times, functions like .: need typeclasses
11:16 takle joined
11:16 <jle`> osa1: you can have multiple ORd instances for types too. but the important thing is that you always use the same instance for a given Map value. and that you always use the same serializer for a given data channel
11:16 ccomb joined
11:16 <jle`> you might have more than one way to serialize something, but the site of serialization and the site of deserialization have to agree on which one to use
11:17 <jle`> (like the site of insertion and the site of lookup have to agree on which comparator method to use)
11:17 <osa1> btw in languages like OCaml people solve this problem by parameterizing modules with Eq/Ord providers. different instances then get different types (or something like that, I'm not an expert)
11:17 systadmin joined
11:18 CurryWurst joined
11:18 <osa1> so lookup is attached to the map. you can only use that lookup function
11:18 <osa1> which uses the Ord/Eq etc. provided on initialization
11:18 <osa1> anyway
11:18 <Squarism> Using different API's ive come to juggle between Data.Text, Data.String, Data.ByteString. But its getting tedious. Is there any of them that "can go"
11:19 <osa1> I started to think that most typeclasses suck (and so do APIs that rely on typeclasses heavily)
11:19 <Squarism> (..and forgot to mention - the Lazy variants too)
11:19 <jle`> it is true that most typeclasses suck
11:19 sidei_ joined
11:19 <jle`> it's easier to write a bad typeclass than a good one
11:19 <liste> Squarism: Data.String
11:20 <jle`> but typeclasses have their specific and narrow set of benefits/use cases
11:20 <Squarism> liste, oh ok
11:20 <liste> Squarism: it usually has bad performance
11:20 <jle`> s/typeclasses have their/the idea of a typeclass has its
11:20 <liste> Squarism: Data.Text for text, Data.ByteString for binary data :)
11:20 oisdk joined
11:21 <Squarism> ok!
11:21 <tdammers> you could probably get pretty close with -XImplicitParameters
11:22 zomg joined
11:22 <jle`> Squarism: i've seen libraries like this one https://hackage.haskell.org/package/string-conversions-
11:22 <jle`> but i'm not sure how good of an idea they are
11:22 <tdammers> then you could write something like: let ?toJSON = myCustomSerializer in serveJSON someSerializableValue
11:22 <angerman> anyone got some avx exercising code handy?
11:23 <tdammers> dynamic binding is ugly though IMO
11:24 <Squarism> jle`, haha
11:24 defaultnick_ joined
11:25 <Squarism> I confess on beeing lazy in digging deeper into strings. Performance isnt my biggest concern. So i guess its written for people like me
11:25 cinimod joined
11:25 whaletechno joined
11:26 oisdk joined
11:27 oisdk joined
11:27 nikolah joined
11:27 LeaChim joined
11:27 V3 joined
11:28 deepfire joined
11:28 watabou joined
11:34 hexagoxel joined
11:36 baldrick joined
11:36 andrei_chifa joined
11:40 <dminuoso> Okay, so I've just started with Haskell a short while ago and found myself writing some strange Ruby code. Is this kind of like a Monad what I just did? https://eval.in/749667
11:40 Jacoby6000_ joined
11:42 defaultnick_ joined
11:43 shurick joined
11:43 tommd joined
11:43 roundhouse joined
11:43 revtintin joined
11:44 Sampuka joined
11:44 <jle`> it looks similar to List
11:44 <tdammers> kind of, it seems
11:44 <tdammers> but not quite
11:44 laz joined
11:44 <tdammers> initialize() is roughly return, and call() is roughly bind
11:44 <jle`> and list is indeed a monad, if that counts
11:44 fnurglewitz joined
11:44 <tdammers> however,
11:44 <tdammers> :t (>>=)
11:44 <lambdabot> Monad m => m a -> (a -> m b) -> m b
11:45 <tdammers> whereas call() is closer to :: m a -> a -> m a
11:45 <tdammers> m being GuessWhatThisIs, and m a being an instance of that class
11:46 <roundhouse> hi, if I have a typeclass with a parametric type family, "class A a where; data A a :: *" and I want to instansiate this class for a type "data B b = { ... }" I'd like to specify the type "data A a = b" but I get an error "Not a dataconstructor 'b'". Any ideas how I can do this?
11:46 <jle`> yeah, i wouldn't say that it exports a monadic interface. just that it's similar to lists, and that list is a monad
11:46 srbaker_ joined
11:46 <jle`> but doesn't ruby also alrady have arrays?
11:47 <jle`> roundhouse: you need to give an ADT a constructor
11:47 netheranthem joined
11:47 <dminuoso> Give me a minute to process what has just been said in here before I respond. :)
11:47 <jle`> roundhouse: how familiar are you with algebraic data types?
11:47 <roundhouse> jle`: somewhat
11:47 govg joined
11:47 <roundhouse> jle`: can you recommend a reading?
11:47 pylbrecht joined
11:47 <jle`> oh wait, this looks more like an issue with data families
11:48 <jle`> but yeah, ADT's are something most introduction haskell books teach
11:48 <tdammers> it does produce a cartesian product similar to how you'd do it in Haskell using the list monad
11:48 <jle`> data Maybe a = Nothing | Just a
11:48 <roundhouse> jle`: That I know
11:48 <jle`> dminuoso: my answer was that it resembles a monad, but only because it resembles a list, and lists are a monad
11:48 <jle`> dminuoso: so if you had shown me ruby arays, i would also say that arrays resemble a monad
11:48 <jle`> to the same degree that your example does
11:48 guardianJ joined
11:48 <jle`> roundhouse: or how about data Identity a = Identity a
11:49 <jle`> do you see why you can't have `data Identity a = a` ?
11:49 dhil joined
11:49 <jle`> ADT's need constructors
11:49 <jle`> for Maybe, you have the Nothing constructor and the Just constructor
11:49 <jle`> for Identity, you have the Identity constructor
11:49 <jle`> but you can't just plop in data Ident a = a
11:49 <roundhouse> ok
11:50 <roundhouse> Makes sense
11:50 <jle`> ADT's are sums of constructors, so it's data MyADT .. = Constr1 ... | Constr2 ... | Constr3 ...
11:50 <Rodenbach> Let’s say I have a function f and 15 callers of it. Now I need to update the signature of f and test it with one of the callers. Is it possible to update just one caller and ask ghc to compile my program anyway, although I know that there are 14 bugs?
11:50 <lyxia> roundhouse: did you want a data family or a type synonym family
11:50 <jle`> Rodenbach: defer type errors
11:50 <jle`> maybe?
11:51 sid_fule_ joined
11:51 <roundhouse> data family if I understand this correctly
11:51 <Rodenbach> jle`: okay, a compiler option. Sounds good, thx.
11:51 lukaramu joined
11:51 fendor joined
11:51 irons joined
11:51 <jle`> roundhouse: data families require you to associate types with a whole new ADT
11:51 <jle`> so you can do data A a = MyA b
11:52 <roundhouse> Can't I specify a data type of the context?
11:52 <lyxia> data (B b) = MyA b actually :)
11:52 ejay joined
11:52 JeanCarloMachado joined
11:52 <lyxia> A (B b) ughhh
11:52 xall_ joined
11:53 jutaro joined
11:53 <jle`> so you want to write an instance for the type 'B'?
11:53 <jle`> instance A B where ... ?
11:53 <roundhouse> https://github.com/r-raymond/purple-muon/blob/master/src/Client/Assets/Generic.hs
11:53 janos joined
11:53 <roundhouse> Where I'm trying to implement instance AssetLoader (HashmapLoader a ext)
11:53 <jle`> yeah, data families require you to create a whole new adt with new constructors and everything
11:54 <jle`> so if you want it to just point to an old type, can just wrap it in a boring constructor
11:54 <roundhouse> ok that might be a good idea
11:55 fsargent joined
11:55 <jle`> the reason why is so that data families are injective
11:55 <jle`> so type inference is a lot nicer
11:55 <jle`> (as compared to having associated types)
11:55 <roundhouse> I see
11:55 <jle`> if it was type Asset al :: *, then if you wanted to call 'loadAsset' and gave a 'HashmapLoader a ext'
11:55 <roundhouse> I was running into the issue of noninjectivity when I tried to use a type family
11:55 <jle`> then it would be ambiguous which instance you'd want
11:56 <jle`> because more than one instance of AssetLoader might have type Asset Foo = HashmapLoader a ext
11:56 <roundhouse> I see
11:56 <jle`> more than one instance of AssetLoader might have the same Asset type, so calling 'loadAsset x' is amgiuous
11:56 <lyxia> uh
11:56 <roundhouse> thank you very much for explaining this
11:56 <jle`> but with data families, the ambiguity goes away
11:56 <lyxia> It's not Asset a1 is the type of loadAsset
11:57 <jle`> oh
11:57 <jle`> sorry, my bad :)
11:57 <jle`> but yeah, the idea is that you can't infer what 'a1' is just from seeing 'Asset a1', if Asset is a type family
11:57 janos__ joined
11:57 <jle`> but if Asset is a data family, then a value of type 'Asset a1' is unambiguously associated with a single a1
11:58 <jle`> (in the first case, multiple instances might have type Asset Foo = Int, type Asset Bar = Int, type Asset Baz = Int, so if i saw 'Asset a1 ~ Int', i couldn't tell you want a1 was)
11:59 <lyxia> Since all type class methods have at least one occurence "a1" in their type which is not part of "Asset a1", type inference is much less of a problem
11:59 Robert__ joined
11:59 <Robert__> takeWhile (/=' ') "This is a sentence"
12:00 <Robert__> Why does this code output "This"
12:00 <Ferdirand> that sounds like a reasonable output
12:00 <Ferdirand> which part is confusing to you ?
12:00 balor joined
12:00 <Robert__> I'm new to haskell, is this the correct IRC channel to be using
12:00 <liste> Robert__: what do you expect it to output?
12:00 <jle`> Robert__: it takes items from 'This is a sentence', as long as the items are not ' '
12:00 janos joined
12:00 schjetne joined
12:01 <lyxia> roundhouse: if HasmapLoader a ext is to define a as the type of asset, it seems much more convenient to define an associated type synonym family.
12:01 <jle`> so it'll take T, then h, then i, then s, but as soon as it sees ' ', it quits
12:01 <Robert__> Oh that is, in fact, very logical :)
12:01 <Robert__> my bad
12:02 <Robert__> I'm also a bit confused regarding the 'where
12:02 ragepandemic joined
12:02 <Robert__> so lets say I want to do a takeWhile on a list
12:02 bjz joined
12:02 pleax joined
12:02 <Robert__> how do I make more complicated functions as the condition
12:02 Snircle joined
12:02 <jle`> you can pass in any 'a -> Bool' as your condition
12:02 <jle`> so if your condition is complicated, you can define it elsewhere and give it a nice name
12:03 <jle`> myPredicate x = ...
12:03 <jle`> and then do 'takeWhile myPredicate'
12:03 patbecich joined
12:04 <Robert__> hmm so in what cases would you use the 'where' syntax.
12:05 <Robert__> so something like 'takeWhile myPredicate xs'
12:05 <Robert__> followed by 'where myPredicate = ...'
12:05 <jle`> that's one way to do it
12:06 caumeslasal joined
12:06 defaultnick joined
12:06 deepfire joined
12:07 Swizec joined
12:07 unK_ joined
12:07 lelf joined
12:08 <Robert__> ok let's say I want the square numbers less than 50, so myPredicate needs to check if the input is a perfect square.
12:09 <Robert__> result = takeWhile (square) [1..50]
12:09 <Robert__> then how do I define 'square' using the 'where' notation?
12:09 bollu joined
12:10 jan_path joined
12:10 GK___1wm____SU joined
12:11 <Rodenbach> I have data Foo c = Clear c | XYZ and want to match this bar when Clear wraps an Integer. bar (Clear (Integer i)) 20 = i+100 <= this doesn’t work. How can I write this pattern?
12:12 <ski> Rodenbach : what is the expected type of `bar' ?
12:12 <Rodenbach> I want it to return whatever is wrapped by Clear.
12:12 eacameron joined
12:13 <ski> Robert__ : `.. where square n = ..n..', where `..n..' is a boolean condition checking whether `n' is a square ?
12:13 <tdammers> Rodenbach: Integer is the name of the type, it's not a term-level constructor
12:13 <ski> Rodenbach : how about `bar :: Foo Integer -> Integer -> Integer' ?
12:13 sidei_ joined
12:13 <ski> Rodenbach : then `bar (Clear i) 20 = i+100' would work as a definition
12:13 <Rodenbach> tdammers: I also tried bar (Clear (i::Integer)) 10 = i+100
12:13 unK_ joined
12:14 <tdammers> Rodenbach: and what is the error you get?
12:14 <lelf> [trifecta/parsers] Why on earth? runUnspaced <$> parseString (Unspaced <$> symbol "x" <* eof) mempty "x " => Success "x"
12:14 <Rodenbach> tdammers: Illegal type signature 'Integer'.
12:14 <ski> Rodenbach : what is your type signature ?
12:15 defaultnick joined
12:15 <ski> to use `i :: Integer' in a pattern like that you need (`PatternSignatures' or) `ScopedTypeVariables', a language extension, enabled
12:15 <tdammers> Rodenbach: try attaching a type signature to the entire function, rather than inside the pattern match
12:15 <lyxia> Rodenbach: you can't match on types if that's what you're tyring to do
12:15 GK___1wm____SU joined
12:15 <Rodenbach> lyxia: okay, I think I was trying that.
12:15 stoopkid joined
12:15 <Rodenbach> Will think about this then again, thanks.
12:16 <tdammers> Rodenbach: what lyxia said; you cannot dispatch on types at runtime, because types are resolved at compile time
12:16 <ski> you can't make `bar' behave one way if `i' is an `Integer', and another way if it isn't ..
12:16 <lyxia> Rodenbach: you can restrict the type of the function so that the caller can't ever pass something that doesn't wrap an integer.
12:16 <ski> .. without resorting to `Typeable, i.e. -- but you probably don't want to reach for that here
12:16 systadmin joined
12:17 <Robert__> :ski yes that makes sense
12:17 GK___1wm____SU joined
12:17 <ski> Robert__ : also, `takeWhile square [1 .. 50]' will work just fine, without the round brackets
12:18 <lyxia> lelf: "symbol" skips trailing whitespace
12:18 <Robert__> ok and my mind is pretty blank, how would I implement a boolean to check if an input is square
12:19 <jan_path> lyxia: The Unspaced newtype is supposed to disable that behaviour.
12:19 <ski> Robert__ : one way would be to iteratively subtract odd integers, until you reach zero or a negative integer
12:20 <ski> > scanl (+) 0 [1,3 ..]
12:20 <lambdabot> mueval-core: Time limit exceeded
12:20 <Robert__> clever. hm maybe I could just make a list of squares with map (^2) [1..] and see if it's inside
12:20 <Robert__> probably quite inefficient lol
12:20 bollu joined
12:21 <Robert__> then I'd have 'where square x = elem $ map (^2) [1..]'
12:21 <Robert__> is that correct?
12:21 <ski> > take 16 (scanl (+) 0 [1,3 ..])
12:21 defaultnick joined
12:21 <lambdabot> [0,1,4,9,16,25,36,49,64,81,100,121,144,169,196,225]
12:21 <ski> Robert__ : doesn't work for non-squares
12:21 bollu left
12:21 certainty joined
12:21 <ski> Robert__ : try using `takeWhile' and `null', perhaps ?
12:22 systadmin joined
12:22 <lyxia> jan_path: OH. I see sorry.
12:22 <Robert__> what do you mean by 'null'
12:22 <Robert__> looking it up on hoogle.
12:22 <ski> @src null
12:22 <lambdabot> null [] = True
12:22 <lambdabot> null (_:_) = False
12:22 <lyxia> lelf: you flipped the order of runSpaced and parseString I think.
12:22 JeanCarloMachado joined
12:23 halogenandtoast joined
12:23 <Robert__> man that's useful
12:23 <Robert__> I don't understand how I'd use null in this case
12:23 <ski> usually pattern-matching is nicer. sometimes `null' is handy
12:23 <Robert__> right. Well, thanks for your help m8, I learnt something new about haskell today
12:24 <ski> > dropWhile (< 16) (map (^ 2) [0 ..])
12:24 oisdk joined
12:24 <lambdabot> [16,25,36,49,64,81,100,121,144,169,196,225,256,289,324,361,400,441,484,529,5...
12:24 <ski> > dropWhile (< 7) (map (^ 2) [0 ..])
12:24 rgr joined
12:24 <lambdabot> [9,16,25,36,49,64,81,100,121,144,169,196,225,256,289,324,361,400,441,484,529...
12:24 defaultnick_ joined
12:24 <ski> in the first case, the list starts with `16', in the second case it doesn't start with `7'
12:24 <jan_path> lelf: runUnspaced (symbol "x" *> eof :: Unspaced Parser String)
12:25 <Robert__> > takeWhile (<50) $ map (^2) [1..]
12:25 <ski> > (takeWhile (<= 16) . dropWhile (< 16) . map (^ 2)) [0 ..]
12:25 lep_ joined
12:25 <lambdabot> mueval-core: Time limit exceeded
12:25 <lambdabot> [16]
12:25 <jan_path> The signature should be `Unspaced Parser ()`
12:25 GK___1wm____SU joined
12:25 <ski> > (takeWhile (<= 7) . dropWhile (< 7) . map (^ 2)) [0 ..]
12:25 <lambdabot> []
12:25 <ski> Robert__ : then you could use `null' on this list ..
12:25 <Robert__> ah I understand
12:25 Levex joined
12:26 <ski> Robert__ : instead of doing a `takeWhile' after the `dropWhile', it might be simpler to just check the first element of the list directly ..
12:26 FullyFunctional joined
12:26 <Robert__> that seems to make sense.
12:26 <ski> using `null' was the first thing that came to my mind, re `map (^ 2) [0 ..]'
12:26 <jan_path> lelf: Wrapping in Unspaced after using symbol does not do anything. You have to use the symbol of the `Unspaced Parser a' instance.
12:26 <ski> (note that i started at `0', not `1', because `0' is also a square)
12:29 Nicnux joined
12:29 <lelf> jan_path: ah! thanks!
12:29 nemorichard joined
12:31 ccomb joined
12:31 eacameron joined
12:33 bernouli joined
12:36 cur8or joined
12:36 caumeslasal joined
12:37 RusAlex joined
12:37 ramzifu joined
12:40 systadmin joined
12:41 epsilonhalbe joined
12:43 suls joined
12:46 rgr joined
12:46 dtornabene joined
12:46 coot joined
12:48 ystael joined
12:48 xall_ joined
12:52 shayan_ joined
12:54 buglebud_ joined
12:55 <Squarism> i just want to pretty print some haskell code for a web page im making. Anyone know a simple / good looking solution to that?
12:55 seib2_ joined
12:56 xcmw joined
12:57 <opqdonut> Squarism: pandoc has haskell syntax hilighting
12:58 <opqdonut> e.g. http://pandoc.org/demo/example18a.html
12:59 plutoniix joined
12:59 dsh joined
13:00 GreySunshine joined
13:00 chlong joined
13:01 lelf` joined
13:02 cads joined
13:02 Nuub joined
13:02 sepp2k joined
13:03 schismz joined
13:03 <schismz> hello all
13:03 janos joined
13:03 seib2_ left
13:04 schismz left
13:04 patbecich joined
13:05 exferenceBot joined
13:06 <ertes> pandoc's syntax highlighting for haskell sucks though
13:06 ajhager2 joined
13:07 systadmin joined
13:07 oisdk joined
13:07 exferenceBot joined
13:07 <merijn> Is it at least correct? Because the one github uses barfs on lots of things (like DataKinds quotes)
13:09 defaultnick joined
13:10 <bennofs1> Squarism: pygments perhaps?
13:10 vektorweg1 joined
13:10 <Squarism> opqdonut, i tried that - but my output was black-n-white and not monospaced
13:10 beanbagula joined
13:10 <sbrg> ertes: not in my experience
13:10 <Squarism> bennofs1, ok ill check it out
13:11 GreySunshine joined
13:11 eklavya joined
13:11 <sbrg> I used pandoc to compile markdown+lhs to pdf and it looked very nice
13:12 <Squarism> opqdonut, maybe one needs some .css for it to be complete
13:12 balor joined
13:13 cschneid_ joined
13:14 Levex joined
13:14 <ertes> merijn: i haven't used it on any complicated code
13:15 <ertes> but it can't properly tell things apart that are really distinct… effectively i ended up not using colour at all and just emphasising keywords
13:15 Ted___ left
13:15 <ertes> that's the only thing it gets right for the most part
13:16 cinimod joined
13:16 <cris_> hi all, i uploaded a package to Hackage: https://hackage.haskell.org/package/carbonara-1.0.0/candidate
13:16 dmiles joined
13:16 <ertes> sbrg: this isn't about looks, but about properly parsing and tagging haskell code
13:16 <cris_> how could i upload it also to nixpkgs ? could you recommend a nixpkgs upload user guide?
13:16 janos joined
13:17 <ertes> cris_: it will be in nixpkgs automatically from the next hackage update cycle forward
13:17 <ertes> those happen frequently
13:18 <cris_> by the way, other packages in hackages shows the source code after clicking the module name, how do i enable this as well?
13:18 Levex joined
13:19 janos__ joined
13:20 <bennofs1> cris_: it will take a will for hackage to build the documentation for your package
13:20 janos___ joined
13:21 baldrick joined
13:21 <ertes> cris_: could there be a problem with your library? it doesn't seem to be on hackage properly
13:21 defaultnick__ joined
13:22 <ertes> cris_: there is a warning at the top
13:22 ramzifu joined
13:22 <bennofs1> ertes: it's a candidate
13:22 <ertes> ah… i didn't know those existed
13:22 <bennofs1> ertes: that warning is harmless
13:22 epsilonhalbe joined
13:22 epsilonhalbe left
13:22 <ertes> cris_: in that case: i don't know if the nixpkgs hackage updater will up candidates
13:23 <ertes> *pick up
13:23 <bennofs1> cris_: ertes: i don't think it will. it'll pick it up after the candidate is released though
13:23 <ertes> of course you can always just use a local haskellPackages override to include your package
13:24 janos joined
13:24 mmn80 joined
13:24 <cris_> hi ertes, i m not sure how to resolve the warning , I immitate the structure of "turtle" package
13:24 defaultnick joined
13:24 <bennofs1> cris_: the warning is harmless
13:25 <ertes> bennofs1: is that hackage's way of saying: "YOU DIDN'T USE "Control" or "Data" or …!!!"?
13:25 <bennofs1> cris_: it won't show if the candidate is released
13:25 <bennofs1> ertes: yes
13:25 <ertes> i see
13:25 <cris_> here is my repo is github: https://github.com/szehk/Haskell-Carbonara-Library
13:26 jomg joined
13:26 <cris_> this is an initial release , it only include very few functions , i already write up a bunch of useful function to interact with mysql and postgresql
13:26 cdg joined
13:28 cdg joined
13:29 <cris_> in hackage, it says that package "candidate" is a new function, so i use it, do you guys know how long it will take to get from "candidate" to real package in hackage?
13:29 mr_sm1th joined
13:30 <lyxia> it's up to you
13:30 watabou joined
13:30 <ertes> cris_: BTW: isWeekday d = not (isSaturday d || isSunday d)
13:31 <lyxia> cris_: you must release the candidate yourself, I think by following the link "edit package information"
13:31 <ertes> isSunday d = toModifiedJulianDay d `mod` 7 == 4
13:31 <cris_> ertes: your version is clearer
13:32 rcsole joined
13:32 <ertes> cris_: remember that functions like (==) return a Bool by themselves… you don't need to guard on it
13:32 <lyxia> cris_: there shouldn't be a "dist" directory in your repo
13:33 lukaramu_ joined
13:33 danthemyth joined
13:34 <ertes> cris_: also there are easy ways to abstract most of the functions away, because having separate functions for each day makes them awkward to work with, because you couldn't abstract over the day easily: isA d d' = toModifiedJulianDay d `mod` 7 == d'
13:34 <ertes> d `isA` sunday
13:35 magneticduck joined
13:35 <cris_> thanks ertes , i copied down your words and will modify accordingly
13:36 <ski> isSunday,isMonday,isTuesday,isWednesday,isThursday,isFriday,isSaturday :: Day -> Bool
13:36 <ski> [isWednesday,isThursday,isFriday,isSaturday,isSunday,isMonday,isTuesday] = [isDay i | i <- [0 .. 6]]
13:36 <ski> where
13:36 <ski> isDay i day = toModifiedJulianDay day `mod` 7 == i
13:37 <cris_> thanks ski
13:37 Cale joined
13:37 pleax joined
13:37 <ertes> personally i wouldn't implement 'isSunday' etc. at all
13:38 rgr joined
13:39 defaultnick joined
13:39 <lordcirth> Yeah, just use day == 0
13:39 AndreasK joined
13:41 codesoup joined
13:42 defaultnick joined
13:42 Claudius1aximus joined
13:42 sword865 joined
13:43 sdothum joined
13:43 pleax joined
13:43 tommd joined
13:44 nemorichard joined
13:44 cpennington joined
13:46 janos joined
13:48 GK___1wm____SU joined
13:49 neetrichard joined
13:49 pleax joined
13:49 sidei joined
13:50 bob3434 joined
13:50 bjz joined
13:50 <cris_> lyxia: when i use $ cabal sdist , it will auto create the /dist folder , how do i prevent it from upload to github?
13:50 nemorichard joined
13:51 <ertes> cris_: see: man gitignore
13:53 vektorweg1 joined
13:53 violeta left
13:53 Mike_G joined
13:56 fendor joined
13:56 rgr joined
13:56 neetrichard joined
13:57 pleax joined
13:57 nemorichard joined
13:58 vektorweg1 joined
14:00 <Mike_G> Hi everyone! The question arose when I read sources of Data.Complex. Is it possible to rewrite GHC.<Something> to have type inference not only for integer and real literals, but also for complex ones? Eg (2 + J 3.0) should be (Fractional a => Complex a) and literal "2" be interpreted as (Fractional a => a). J here is type constructor of pure complex number (J x == 0+i*x). Correct me, if I'm knocked in a wrong door.
14:01 Jacoby6000_ joined
14:01 rgr joined
14:01 harfangk joined
14:02 <ertes> Mike_G: instead of writing (2 + J 3.0) write (2 :+ 3.0)
14:02 <ertes> :t 2 :+ 3.0
14:02 <lambdabot> Fractional a => Complex a
14:02 <Mike_G> I know how to use Data.Complex module. The question is about rebuilding the prelude some way
14:03 halogenandtoast joined
14:03 <Mike_G> just a whim, but interested
14:03 <ertes> Mike_G: you could write a pattern synonym J for imaginary numbers, if you want
14:03 defaultnick__ joined
14:03 Bish joined
14:03 <ertes> @let pattern J x = 0 :+ x
14:03 <lambdabot> .L.hs:167:9: error: Not in scope: data constructor ‘J’
14:04 marr joined
14:04 <bennofs1> :t 2 + (0 :+ 1)
14:04 <lambdabot> RealFloat a => Complex a
14:04 <bennofs1> :t 2 + (0 :+ 3.0)
14:04 <lambdabot> RealFloat a => Complex a
14:05 <c_wraith> Mike_G: you could trivially write a data type that worked that way. It just wouldn't be Data.Complex.Complex
14:05 <ertes> or even just a regular function 'i'
14:05 kosorith joined
14:05 roundhouse joined
14:05 <cris_> hi ertes , i have added a .gitignore file to my repo folder , however, after i type $ git commit -am "commit 6" , and also push it again to github , the "dist" folder is still there
14:05 kolko joined
14:05 <c_wraith> cris_: wrong channel?
14:06 patbecich joined
14:06 <c_wraith> oh, I guess it's related to working on a haskell package.
14:06 Jacoby6000_ joined
14:06 <ertes> cris_: gitignore doesn't apply to things that are already in the repo, so you need to commit its deletion first… for more details, there is also a #git channel
14:06 <cris_> c_wraith : no , see this: https://github.com/szehk/Haskell-Carbonara-Library
14:07 <cris_> thanks
14:07 <bennofs1> why would addition of complex numbers require RealFloat? :o
14:07 <bennofs1> :t (+) `asAppliedTo` undefined :+ undefined
14:07 <lambdabot> RealFloat a => Complex a -> Complex a -> Complex a
14:08 <c_wraith> bennofs1: you don't get to apply constraints per-operation. abs and signum require it, so everything in the class gets it
14:08 rixile joined
14:08 <bennofs1> c_wraith: oh, forgot that (+) was part of Num...
14:08 <ertes> > signum (1 :+ 1)
14:08 <lambdabot> 0.7071067811865475 :+ 0.7071067811865475
14:08 <ertes> > signum (5 :+ 5)
14:08 <lambdabot> 0.7071067811865475 :+ 0.7071067811865475
14:08 <ertes> bennofs1: it probably uses 'significand' or something
14:09 <c_wraith> there's a sqrt in signum
14:09 <c_wraith> :t sqrt
14:09 <lambdabot> Floating a => a -> a
14:09 <ertes> i could also imagine that it has a few isNaNs here and there
14:09 <Claudius1aximus> iirc it also does tricks with exponents to avoid overflow on intermediate values in abs
14:09 <c_wraith> Huh. I can never recall what's in the various numeric classes
14:10 pleax joined
14:11 <ertes> c_wraith: Floating is like "we have operations that are typically floating-point", while RealFloat, as the name suggests, is: "we fully appreciate that we're floating point" =)
14:11 neetrichard joined
14:11 <c_wraith> Oh yes, a totally obvious distinction. :)
14:11 sidei joined
14:13 <ertes> Real is probably the weirdest class
14:13 <ertes> :t toRational
14:13 <lambdabot> Real a => a -> Rational
14:13 certainty joined
14:13 <c_wraith> most misnamed, at least :)
14:13 freusque joined
14:16 <Mike_G> Thank you. let j x = (0 :+ x) seems very elegant, but what if I wanted something low-level-built-in? E.g. 1+3.2i. Is there a way to make GHC read 3.2i as new complex type?
14:16 yqt joined
14:16 <Mike_G> and operate complexes globaly
14:16 ems36 joined
14:16 alx741 joined
14:16 <ski> > let i = 0 :+ 1 in 3.2*i
14:17 V3 joined
14:17 <lambdabot> 0.0 :+ 3.2
14:17 <Mike_G> not 3.2*i but 3.2i
14:17 cyborg-one joined
14:17 dan_f joined
14:17 <ski> i don't think so
14:18 <ertes> it has a plugin system, but now we're getting into over-engineered-and-less-familiar-to-haskellers territory
14:18 mda1 joined
14:18 rgr joined
14:18 zzz joined
14:18 <ski> i suppose one could do some TH ..
14:18 <ertes> QQ
14:19 <Mike_G> i did dig into the GHC.Prim and found some magick hashes # which are seem suitable, but i understood nothing :)
14:20 merijn joined
14:20 dhil joined
14:21 <Mike_G> > [17:18] <ski> i suppose one could do some TH .. - TH?
14:21 <lambdabot> <hint>:1:35: error: parse error on input ‘do’
14:21 <ski> Template Haskell
14:21 <ski> QuasiQuotation
14:21 coot joined
14:22 <tdammers> hmm, I wonder what options there are to make a Haskell host application extensible with plugins at runtime
14:22 <Mike_G> Oh. It is not I wanted:) Idea was to rebuild prelude with complexes as general numeric type
14:23 <tdammers> so far, my ideas are either dynamically loading libraries with a known binary interface (ugh), or embedding an interpreter for some scripting language
14:23 cdg_ joined
14:23 ccomb joined
14:23 <ski> with <https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#template-haskell-quasi-quotation>, one could probably be able to write something like `[cplx| 1+3.2i |]'
14:23 <tdammers> the latter seems more promising, especially since I'd want to be able to sandbox plugins somewhat
14:23 jsgrant-_ joined
14:24 <ski> Mike_G : "rebuild prelude with complexes as general numeric type" means ?
14:24 <c_wraith> there's hslua for that sort of thing
14:24 Levex joined
14:24 theelous3 joined
14:25 <tdammers> c_wraith: hmm, yeah, unfortunately the scripting language would then be lua...
14:25 ramzifu joined
14:25 <c_wraith> there are far worse choices than lua
14:25 mbw joined
14:26 <Mike_G> ski, it means that I just wrote: constructions like 3+2.2i are native and handled without any :+ and so on
14:26 <tdammers> c_wraith: true
14:26 <c_wraith> Mike_G: you can do that if you create your own type. nothing in prelude needs to change.
14:27 <c_wraith> Mike_G: but the ways of doing that are all kind of ugly hacks that end up being worse to work with than what already exists
14:27 <Mike_G> how to make GHC interpret 3.2i-like literals as unboxed type?
14:27 <c_wraith> literals aren't unboxed types
14:28 <Mike_G> they arent, yes
14:28 Boomerang joined
14:28 shesek joined
14:29 <ski> Mike_G : what you're asking for is more a custom concrete syntax, rather than anything that would have to be specially supported, internally so to speak, in libraries
14:29 m0bic2 joined
14:30 <merijn> c_wraith: You can write unboxed literals in GHC
14:30 <ski> @type 3.2# -- unboxed literal
14:30 pleax joined
14:30 <lambdabot> GHC.Prim.Float#
14:30 <c_wraith> but that's completely irrelevant to the question
14:31 Cale joined
14:31 Gloomy joined
14:31 napping joined
14:32 watabou joined
14:33 <Reisen> Are there any Prelude imports that I can use that will filter out adjacent duplicates in a traversable?
14:34 <Mike_G> I just wonder, if it is possible. It seemed for me, because I figured out that there are built-ins like +# and all other operations are something on the top of *#. Also, do Prelude libs convert 3.2 into 3.2# in its interriors? In order to make machine +#
14:34 <merijn> Reisen: "map head . group", I think?
14:34 <byorgey> Reisen: no, because Traversables can't be filtered in general.
14:34 <merijn> oh, wait, for Traversable
14:35 <Reisen> Sorry, merijn that is indeed what I wanted, the traversable was my red herring, ignore that
14:35 <Reisen> Thank you
14:35 `^_^v joined
14:35 <byorgey> ah, ok, merijn guessed right =)
14:35 <Reisen> Yeah, my bad wrong terminology
14:35 <byorgey> no worries
14:36 <Reisen> Just out of interest though
14:36 <Reisen> Why can a traversable not in general be filtered?
14:36 <codedmart> What is the best way to generate random alphanumeric string/text?
14:36 <Reisen> Now that It's been mentioned I'm curious
14:36 <ski> Mike_G : `3.2', of type `Float', is short for `F# 3.2#', in GHC
14:36 <codedmart> There seems to be much differing ways according to google search.
14:36 <byorgey> Reisen: because Traversable only lets you do something at each element but you have to keep the same shape.
14:37 <byorgey> Reisen: e.g. binary trees are Traversable, but what would it mean to "filter" a binary tree?
14:37 <Reisen> Ah, I guess that makes sense, in the sense you couldn't strip off a subtree and fix it without more context
14:37 <byorgey> right
14:37 <Reisen> Gotcha, seems obvious when put that way
14:37 <Reisen> Thanks
14:37 <byorgey> Reisen: however, there is http://hackage.haskell.org/package/witherable ;-)
14:37 ChristopherBurg joined
14:37 <merijn> byorgey: You've got work: https://github.com/diagrams/monoid-extras/pull/32 ;)
14:37 <byorgey> merijn: thanks =)
14:38 <Mike_G> ski : Oh, thank you. I still don't understand how it works and it's a source of my questions:)
14:38 roconnor joined
14:38 <Reisen> byorgey, what fantastic function names
14:38 <Reisen> blightM
14:38 <byorgey> yes, haha =)
14:39 <byorgey> for more fantastic function names, see http://hackage.haskell.org/package/these
14:39 albertid joined
14:40 <ski> (in general, `3.2' is short for `fromRational 3.2', where `3.2' there is interpreted directly as a `Rational')
14:40 <Rodenbach> Is it possible to implement Show for a certain function?
14:41 bigos joined
14:41 <ski> (similarly, `3' is short for `fromInteger 3', with `3' there being an `Integer')
14:41 <byorgey> Rodenbach: what do you mean by "for a certain function"?
14:41 <Rodenbach> myAdd a b = a + b I want to show [myAdd, myAdd]
14:42 <Rodenbach> For this specific function I would like to implement Show. If that is possible.
14:42 <tdammers> it is technically possible to implement Show instances for functions, but they won't be lawful
14:42 defaultnick__ joined
14:42 <byorgey> Rodenbach: how would you want to show it?
14:43 <Rodenbach> byorgey: as the String "<myAdd>"
14:43 initiumdoeslinux joined
14:43 <tdammers> the problem is that your show implementation cannot really look inside the function, because the only things you can do with function values is apply them, and pass them around
14:43 <byorgey> Rodenbach: no, that is not possible.
14:43 tchajed joined
14:43 <ski> `myAdd' is indistinguishable from `(+)' itself
14:43 <tdammers> neither will give you the function name, nor the implementation details
14:43 <ski> function values don't carry around names
14:44 <ski> (just like a list like `[2,3,5,7]' doesn't know what names it may be known under, in different parts of the program)
14:44 <Rodenbach> I know about ghci’s :m + Text.Show.Functions
14:44 <byorgey> Rodenbach: perhaps you might be interested in doing something like data MyFunctions = MyAdd | MySub | ... and then have a list of [MyAdd, MyAdd] which you can Show just fine. Then define an interpreter MyFunctions -> (Int -> Int -> Int) or something like that
14:44 <Rodenbach> That’s not what I’m looking for. Okay, so I’ll work around it.
14:45 <Rodenbach> byorgey: possibly I will do this.
14:45 <tdammers> Rodenbach: why do you need this Show instance? What is the problem you are trying to solve?
14:45 sidei joined
14:45 <Rodenbach> tdammers: I am evolving Programs in a Genetic Programming system that I’m implementing.
14:45 <napping> ski: are you sure there's nothing interesting in the info table?
14:45 <max3> why doesn't everything derive Show by default?
14:45 <Rodenbach> tdammers: and it would be nice to see which functions are part of the genome.
14:45 <* ski> . o O ( `instance (Bounded a,Enum a,Show a,Show b) => Show (a -> b)' )
14:46 <napping> Rodenbach: then you will need your own type of syntax trees to actually do the mutuataions
14:46 <byorgey> Rodenbach: yes, in that case, I think you almost certainly want to define a data type representing the abstract syntax of your programs, rather than representing them directly as functions
14:46 <napping> and those can be Show no problem
14:46 <ski> max3 : not everything can be made an instance of `Show' (in a sensible fashion)
14:46 mizu_no_oto_work joined
14:46 <Rodenbach> Oki.
14:47 <max3> ski, at worst you could have a memory address
14:47 steeze joined
14:47 <merijn> max3: You assume functions HAVE a memory address
14:47 <byorgey> max3: but the spirit of Show is that it should produce valid Haskell expressions, which could be pasted into ghci
14:47 <ski> napping : are info tables in the report ?
14:47 <merijn> byorgey: Even if you throw out that assumption it's hard to do sensibly
14:47 <Mike_G> Is it possible to make GHC interpret `3.2i' as a value of some new type without Template Haskell?
14:48 Levex joined
14:48 <byorgey> merijn: oh, I agree
14:48 <merijn> Mike_G: If you wrap it in a quasi quoter, yes
14:48 <napping> ski: they may be in your implementation
14:48 <max3> merijn, ...where else would they exist?
14:48 <merijn> max3: Deeply inlined and specialised
14:48 <ski> max3 : they could be fused, or otherwise partially evaluated, away
14:48 <napping> you didn't say anything about standard
14:48 <mbw> I have a question about Bifunctors (and maybe Profunctors). According to the lens tutorial on wikibooks, the Const functor is a "vacuous" functor, since both fmap and contramap amount to id. However you can define a Bifunctor instance, of which bimap/first allow applying altering the Const functor: http://lpaste.net/353288 . Is bimap something entirely different than fmap/contramap? Is there some intuition
14:49 <merijn> max3: The fact that you define a function 'foo', doesn't require such a function to actually exist after compilation
14:49 <mbw> behind this?
14:49 <merijn> max3: If all uses of 'foo' have been inlined directly in the calling code, then what?
14:49 <napping> max3: more simply, the GC can move things so it's trickty to have "A" address
14:49 <merijn> napping: That's the fun that gives us "reallyUnsafePtrEquality#" ;)
14:49 <max3> fine. excepting functions
14:50 <napping> merijn: precisely!
14:50 <merijn> Which honestly isn't nearly as scarily named as it oughta be
14:50 <napping> well, maybe some unsafeCoerce and pointer arithmetic too
14:50 eacameron joined
14:50 dfeuer joined
14:50 <merijn> It's up there with accursedUnutterablePerformIO in terms of scariest functions :p
14:50 <byorgey> mbw: bimap is closely related to fmap. I'm not sure I really understand your question. In particular I don't understand your use of the word 'However'. The existence of a Bifunctor instance doesn't contradict the existence of Functor etc. instances
14:51 <ski> mbw : `Functor' is for functors from `Hask' to `Hask'. `Contravariant' is for functors from `Hask^op' to `Hask'. `Bifunctor' is for functors from `Hask * Hask' to `Hask'
14:51 <tdammers> Rodenbach: then I'd go with byorgey's suggestion... encode the possible programs in an AST, and write an interpreter for it
14:51 <merijn> max3: Well, for almost all non-functions you can derive Show easily enough. There's some exceptions which are a bit tricky, such as Handle, MVar, TVar, etc.
14:51 fabianhu joined
14:51 rekahsoft joined
14:51 <max3> merijn, okay so why isn't it done by default is my poitn
14:52 <byorgey> merijn: note that every Bifunctor is necessarily also a Functor, since you can just pass 'id' as the first argument to bimap
14:52 <byorgey> sorry, that was meant for mbw
14:52 dbmikus joined
14:52 <merijn> mbw: Note that (assuming you're familiar with kind signatures) you have "Bifunctor :: (* -> * -> *) -> Constraint"
14:52 skeuomorf joined
14:52 <merijn> Vs "Functor :: (* -> *) -> Constraint"
14:52 <napping> max3: there's also no syntax for asking not to derive something
14:53 dbmikus joined
14:53 <Mike_G> :( The idea was to somehow modify prelude and make complexes available everywhere, in all libraries. (Missusage of /r)
14:53 <max3> napping, that doesn't sound like a real impediment
14:53 <ski> sometimes you don't want a derived `Show' instance
14:53 <merijn> max3: Maybe library authors don't want to expose their implementation?
14:53 dbmikus joined
14:53 <Rodenbach> lol, it’s the first time that I’ve done refactoring in Haskell. Changing the program to show function names took me 50 secs.
14:54 <byorgey> Rodenbach: =D
14:54 <Rodenbach> Funny, the compiler showed me all places that I had to update.
14:54 <mbw> hmm
14:54 <byorgey> Rodenbach: yes, that is a very common experience when refactoring
14:54 <merijn> Rodenbach: Yes, refactoring with Haskell is really nice :)
14:54 <mbw> Is there some law that relates fmap to bimap then?
14:54 <c_wraith> Rodenbach: it's almost like that's what Haskell is best at. Handling changing requirements.
14:54 <lyxia> Mike_G: Let's be creative with syntax and make a function i to write (i 3.2)
14:54 simukis__ joined
14:54 <byorgey> mbw: fmap = bimap id
14:54 <c_wraith> mbw: bimap id f = fmap f
14:54 <ski> sometimes you want to write your own, e.g. generating a string representation of an expression evaluating (in the appropriate environment) to a value equivalent to the given one, but not expressed in terms of data constructors, but rather in terms of the exported abstract operations of the module
14:55 <c_wraith> I typed it slower because I eta-expanded it! :)
14:55 <mbw> ah
14:55 <mbw> so bimap = second
14:55 <napping> max3: it's not huge, but "deriving Show" is pretty short and there are hardly any other classes that might make sense by default
14:55 <mbw> no
14:55 <Mike_G> lyxia, already. I use it in my every project with complex numbers, but wanted...:)
14:55 mohsen_ joined
14:55 <ski> lyxia : ertes suggested that already :)
14:55 <mbw> fmap
14:56 <lyxia> haha okay
14:56 <merijn> mbw: Pretty much
14:56 <max3> napping, the problem is adding it after the fact
14:56 <tdammers> Rodenbach: now you're spoiled for mainstream languages forever. You're welcome.
14:56 <napping> max3: as well as plenty of good reasons not to derive Show, like if you want to write your own, or hide implementation details
14:56 <napping> ah, do you know StandaloneDeriving extension?
14:56 <max3> no i do not
14:56 mkoenig joined
14:56 <napping> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#stand-alone-deriving-declarations
14:57 <tdammers> note however that typical uses of standalone deriving create orphan instances
14:57 <napping> If you can actually see the entire definition of a type, you can derive stuff later
14:57 <mbw> This probably also explains why I can't define contramap in terms of fmap in case of Const, although the implementations look pretty much the same.
14:57 <byorgey> merijn: your PR has some kind of conflict?
14:58 <merijn> byorgey: It does? I didn't pull from master before submitting it. Lemme check
14:58 <mbw> Ok, thanks for clearing things up.
14:58 Guest38728 joined
14:58 <max3> napping, so the value of this is i can put this in a different place than the definition of the type?
14:58 halogenandtoast joined
14:58 <merijn> byorgey: Oh!
14:58 <merijn> byorgey: Yeah, you added documentation comments, which are missing because I didn't update from master
14:58 <napping> well, if you want a Show instance for convenience for some type that didn't provide it (your "after the fact")
14:59 <byorgey> merijn: ah, I see
14:59 dbmikus joined
14:59 <napping> then you can write "deriving instance Show SomeLib.Type
14:59 le_frogballs joined
14:59 kolko_ joined
14:59 <byorgey> merijn: aren't you the one who wanted me to add those comments? ;-)
14:59 <merijn> byorgey: Yes, but I never bothered to pull after writing that initial code :p
15:00 <napping> hmm, intero doesn't work with fltkhs?
15:00 <merijn> But, apparently I can resolve conflicts on the web
15:00 <byorgey> woah, the PR page on github just magically turned green while I was looking at it
15:00 <max3> napping, okay but i still have to write it somewhere
15:00 <napping> yes
15:00 <napping> is that a problem?
15:00 <merijn> byorgey: Yeah, I just used the web UI to resolve the conflict in the online editor and then it's just AJAX fanciness
15:01 <napping> depending what you want, the :print / :sprint in GHCi might be better
15:01 <merijn> The web UI seems to have nuked the trailing newline, not sure if that's important?
15:02 <byorgey> merijn: nah, I don't really care about trailing newlines
15:02 suica joined
15:02 <byorgey> merijn: thanks again
15:02 <Mike_G> Also, the questions of perfomance(eg compared to python) of these complex numbers(3+3*(0:+1)) are not clear.
15:03 guampa joined
15:04 <merijn> Mike_G: I'm pretty confident in saying that "Haskell complex numbers are probably in cases that don't include numpy, faster than python complex numbers"
15:04 <merijn> By like, a large margin
15:04 tsmish joined
15:04 <Mike_G> i meant NumPy.
15:04 alfredo joined
15:04 <merijn> Then "it depends"
15:05 <merijn> Because I dunno how numpy works
15:05 drostie joined
15:05 <shapr> numpy wraps a bunch of C and FORTRAN libs
15:05 Levex joined
15:06 lspitzner joined
15:06 maybefbi joined
15:06 oisdk joined
15:06 takle joined
15:07 patbecich joined
15:07 dhil joined
15:08 tsmish joined
15:08 <Mike_G> It's not clear, then. I have 10^4x10^4 array of complexes to be processed (eg matrix exp). I don't have haskell installed now, but will check prefomance later. If NumPy win, unfortunately I will have to use python instead of haskell :(
15:08 <max3> refactoring might be a joy but debugging is the biggest pain i've ever experienced
15:09 <byorgey> Mike_G: how are you planning to represent and process the matrix in Haskell?
15:09 <tdammers> max3: nah, you just need to use different techniques
15:09 <shapr> max3: your project is 'special' in that way
15:09 <merijn> Mike_G: Just use hblas?
15:09 <Mike_G> Array of complex, suppose
15:09 <merijn> Mike_G: That wraps the same C/FORTRAN libraries that NumPy uses :p
15:09 <tdammers> max3: step debugging Haskell is a lousy experience, but type checks, assertions, unit tests, property tests, etc., are a lot more powerful in Haskell than in, say, JavaScript
15:09 <Mike_G> thanks, will google hblas
15:09 mizu_no_oto_work joined
15:10 <shapr> max3: have you learned about quickcheck?
15:10 <byorgey> Mike_G: yeah, I would use the hblas/hmatrix
15:10 nemorichard joined
15:10 eschnett joined
15:10 <merijn> Honestly, debugging haskell isn't THAT much more of a pain than other languages. Biggest issue for me is parsers
15:10 <merijn> The rest is pretty easy
15:10 <merijn> max3: What's the biggest issue you have with debugging?
15:11 <merijn> @quote refreshing.desert
15:11 <lambdabot> chromatic says: My productivity increased when Autrijus told me about Haskell's trace function. He called it a refreshing desert in the oasis of referential transparency.
15:11 <max3> yes i'm familiar with trace
15:11 <max3> especially traceShowM
15:12 coltfred_ joined
15:12 <max3> this morning it was getting absolutely any kind of signal for why something was failing - i had to add show all the way down the chain of data types
15:12 nick_h joined
15:12 <max3> *i had to derive show
15:12 <mbw> trace should've been called kernighan
15:12 <max3> tdammers, writing more code to debug existing code seems very counterintuitive to me
15:13 Einwq joined
15:13 <tdammers> max3: the advantage of that extra code you write is that you can repeat the debugging
15:14 tommd joined
15:14 <mbw> Is there a way to "compile out" traces, like assertions?
15:14 Cale joined
15:14 drostie joined
15:14 Levex joined
15:14 <max3> in the spirit of haskell i feel like i can generalize that claim to: the advantage of that ____ you write is that you can repeat the _____
15:14 <tdammers> max3: but in this case, I reckon a better strategy would have been either better types, or better unit tests
15:15 <tdammers> max3: and yes, that's a very familiar thought - haskell is big on abstractions and automating yourself away without mercy
15:15 <max3> yes i know - that's the joke
15:15 defaultnick___ joined
15:17 <Mike_G> Does hmatrix(or hblas) works with arbitrary dimensional complex-valued tensors?
15:18 ludat joined
15:19 nick_h joined
15:20 <mbw> I believe Blas3 only includes routines working on matrices.
15:21 afarmer joined
15:21 <mbw> Blas routines are defined roughly like this: Blas1: vector x vector -> _, Blas2: matrix x vector -> _, Blas3: matrix x matrix -> _
15:21 defaultnick__ joined
15:22 <Mike_G> unsuitable :( wanna smth matlab-like
15:23 <mbw> I believe Eigen (C++) can work with arbitrary-dimensional tensors by now.
15:24 <Mike_G> are there haskell bindings?
15:24 ninja_in_neopren joined
15:24 petermw joined
15:24 <Mike_G> yes^
15:25 defaultnick__ joined
15:25 ninja_in_neopren joined
15:25 <mbw> A quick search came up with this https://www.cs.utexas.edu/users/flame/BLISRetreat2015/slides/Devin_BLISRetreat_2015.pdf
15:26 <mbw> Might be something in terms of "things to search for"
15:26 dkdwtq joined
15:26 <mbw> But I am amazed there are Haskell bindings, since Eigen relies heavily on Template Metaprogramming / Expression Templates (compile-time voodoo).
15:29 al-damiri joined
15:29 defaultnick__ joined
15:29 BlueRavenGT joined
15:30 dhil joined
15:30 <max3> is there a way to upgrade a package using stack?
15:31 iainhallam left
15:31 honeymead joined
15:32 <mbw> max3: It should suffice to specify a more current resolver and rebuild, I think.
15:32 watabou joined
15:32 zar joined
15:33 defaultnick__ joined
15:34 <jchia_> lens-aeson question. I have a JSON string x = "{\"a\": {\"b\": 1, \"c\": 2}}". I want to extract the list of keys under the top-level "a" key from it, i.e. (Just ["b", "c"] :: Maybe [Text]). How do I do it with lens-aeson? I know how to get a Maybe (HashMap Text Value) using (x ^? key "a" . _Object).
15:34 b4ff3r joined
15:35 ramzifu joined
15:37 sdothum_ joined
15:37 pasukon joined
15:38 angelos joined
15:38 P1RATEZ joined
15:38 GK___1wm____SU joined
15:39 owiecc joined
15:39 oisdk joined
15:43 kosorith joined
15:44 cdg joined
15:45 <kuribas> Do you guys search for haskell jobs, or are you happy with C#/Java/C++/Python/Ruby/whatever...?
15:45 connrs joined
15:45 <shapr> kuribas: I search for Haskell jobs :-P
15:45 <kuribas> shapr: did you find them?
15:45 Luke joined
15:45 <Mike_G> I search, but I'm kinda noob.
15:45 <merijn> kuribas: Out of all those only C++ would be marginally acceptable, if it was interesting
15:46 <merijn> kuribas: Depends, are you willing to move?
15:46 <srk> hehe, I don't search for jobs but I'm also not happy with python anymore :D
15:46 <kuribas> merijn: prefer not to...
15:46 jsgrant-_ joined
15:46 V3 joined
15:46 <kuribas> merijn: I see that there are some jobs in Berlin, that's not too far...
15:46 xcmw joined
15:46 sgflt joined
15:46 <merijn> kuribas: London?
15:46 <kuribas> possibly
15:46 <merijn> kuribas: Bunch of banks in London recruiting Haskellers
15:47 <Mike_G> There was a haskell vacancy in Singapore
15:47 <merijn> Standard Chartered is also always looking for people in Singapore
15:47 bigos joined
15:47 <merijn> In London there's Standard Chartered (but, they mostly want people in Singapore, I think?), Barclays is looking for Haskell people (at least, I got emailed about them looking for people to start a Haskell team)
15:48 <merijn> Jane Street has an office in London too. It's not Haskell, but ocaml is close enough
15:48 GK___1wm____SU joined
15:48 <kuribas> merijn: yeah C++ would be ok also...
15:48 Cale joined
15:48 <kuribas> merijn: But I don't think C++ is good for large scale application development.
15:48 <shapr> kuribas: I find 'em, but I need to improve my Haskillz
15:48 doodlehaus joined
15:48 <kuribas> shapr: you learn as you do it?
15:49 <shapr> kuribas: I'm also working at a place that has the best bunch of coworkers I've had, so it's hard to leave.
15:50 <kuribas> shapr: what language?
15:50 <shapr> Python/Ruby/Go :-/
15:50 GK___1wm____SU joined
15:50 <shapr> but 1. awesome people 2. company is not spam/military/porn 3. company has funding
15:50 wraithm joined
15:50 <kuribas> shapr: better than Java
15:50 tommd joined
15:51 <lyxia> jchia_: key "a" . _Object . to HashMap.keys
15:51 petrus joined
15:51 le_frogballs joined
15:51 <shapr> kuribas: yeah, we have some Java code, but I've not had to deal with that.
15:51 <shapr> Also, we do some network protocol parsing and I really enjoy that
15:52 <kuribas> Aren't there libs for that?
15:52 <shapr> not for what we do
15:52 <srk> shapr: it's awesome with haskell ;)
15:52 <srk> networking/parsing
15:52 <srk> protocols
15:52 boombanana joined
15:53 <merijn> kuribas: As for finding jobs, are you on haskell-cafe? Are you on /r/haskell? Are you haskellers.com? Do you follow people on twitter?
15:53 hackebeilchen joined
15:53 GK___1wm____SU joined
15:53 <* kuribas> never used twitter
15:53 animated joined
15:53 <shapr> srk: Have you done it? I'd like to write some utility (non-production) code in Haskell, but I HaNS and network-house don't have any SIP support
15:54 <merijn> I see job announcements on -cafe and r/haskell semi-regularly. I've been approached via haskellers.com a few times. dons and some other big community people also retweet job openings
15:54 <eacameron> I read somewhere that enabling TemplateHaskell for a file means that you must define top-level declarations in dependency order (like in C or Python). Can anyone confirm?
15:54 <shapr> What I really want/need is something like scapy in Haskell, where I can load up a pcap, edit the packets, and write out a new pcap.
15:54 <merijn> eacameron: Not afaik?
15:54 <srk> shapr: I've really enjoyed implementing ZRE recently, hand parsing/packing binary data is very easy - https://git.48.io/zre/blob/master/f/src/Data/ZRE.hs
15:55 defaultnick joined
15:55 <kuribas> eacameron: yeah, the order matters.
15:55 sidei joined
15:55 <napping> eacameron: Sort of - it's not full ordering, just that definitions before a top-level splice don't see definitions after
15:55 <eacameron> kuribas: Is that for all declarations or just ones involving TH somehow?
15:56 <shapr> srk: oh that's cool!
15:56 GK___1wm____SU joined
15:56 nick_h joined
15:56 <jchia_> lyxia: Thanks!
15:56 <kuribas> eacameron: I defined some lenses, and I got a strange error message because of the order.
15:56 <kuribas> eacameron: only the ones involving TH, or depending on them.
15:56 <lyxia> eacameron: toplevel invocations of TH separate definitions, so that those before the invocation don't see those after.
15:57 <srk> shapr: it started as a side project to learn networking/protocol parsing and now it's almost production ready :D
15:57 <eacameron> kuribas: lyxia: interesting. Does that apply to QuasiQuotes too?
15:57 defaultnick joined
15:57 <eacameron> kuribas: lyxia: I.e. *not* using TemplateHaskell extension directly
15:58 <kuribas> eacameron: Then it doesn't matter I think...
15:59 <napping> eacameron: "Unlike normal declaration splices of the form $(...), declaration quasi-quotes do not cause a declaration group break."
15:59 <napping> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#ghc-flag--XQuasiQuotes
16:00 <eacameron> napping: Aha! That's the documentation I was looking for!
16:00 fendor left
16:01 fendor joined
16:01 <napping> But doesn't the Q [Dec] let it inspect the environment?
16:01 kolko joined
16:01 mohsen_ joined
16:05 skeet70 joined
16:05 <lyxia> it does
16:07 sid_fules joined
16:07 enitiz joined
16:08 patbecich joined
16:08 cschneid_ joined
16:08 defaultnick joined
16:09 obadz joined
16:10 zero_byte joined
16:12 Aune joined
16:12 JagaJaga joined
16:13 osa1 joined
16:13 sternmull joined
16:15 Copperis joined
16:16 refold joined
16:16 Copperis joined
16:16 GK___1wm____SU joined
16:17 orbifx left
16:18 descender joined
16:18 <napping> so what environment does the quasiquote see?
16:18 insitu joined
16:18 xcmw joined
16:18 defaultnick___ joined
16:19 Mugwump_ joined
16:20 <Mugwump_> hi everyone :)
16:20 jsgrant- joined
16:20 <Mugwump_> I wanted to ask something, I heard that Real World Haskell is outdated. Does learn you a haskell is the way to go for learning haskell ?
16:20 bernouli joined
16:21 raichoo joined
16:21 GK___1wm____SU joined
16:22 max3 joined
16:22 <Theophane> Mugwump_: they don't server the same purpose
16:22 <Theophane> let me find which book I started with
16:23 <byorgey> Mugwump_: you might be interested in https://github.com/bitemyapp/learnhaskell/blob/master/README.md
16:23 <Theophane> yeah, good link byorgey :)
16:23 <Theophane> I think I started with the wikibook
16:23 <Theophane> then the Moronuki
16:23 k0001 joined
16:24 doux joined
16:24 <Theophane> and I'm looking forward her 2nd co-book
16:24 <Mugwump_> Ok !
16:24 <Mugwump_> Thanks you a lot !
16:25 <lyxia> napping: it sees the bindings above itself
16:25 eimantas joined
16:25 <cocreature> real world haskell is still a useful book despite being outdated. but I wouldn’t recommend it as the first book you read
16:27 <teto> beginner here, why wouldn't this work lookForFirstOption :: [String] -> [String]
16:27 <teto> lookForFirstOption rlines = return rlines
16:27 mwilly joined
16:27 <merijn> teto: return does NOT do what you think :)
16:27 <merijn> teto: Return is 1) not a keyword and 2) not the way functions return values
16:27 serendependy joined
16:28 <merijn> teto: If you wanted a function the immediately returned it's argument, you'd write "lookForFirstOption rlines = rlines"
16:29 thewickedaxe joined
16:29 thewickedaxe left
16:30 <teto> merijn: ok thanks got it working, I read the tutorials 2 months ago, then couldn't practice.thanks i got it working
16:30 xall_ joined
16:30 defaultnick___ joined
16:30 V3 joined
16:31 mbw joined
16:31 rgr joined
16:33 GK___1wm____SU joined
16:34 <mbw> I have written a little project, which 1. Probably contains a lot of dead code, and 2. is unnecessarily distributed over 5 modules, where maybe 1-2 would have sufficed. So I want to really shrink it down. What is the most practical way of getting rid of dead code? Explicit module import lists, or do I need explicit export lists as well?
16:35 <mbw> Or is there some convenience option for ghc/stack?
16:35 watabou joined
16:35 iomonad joined
16:35 <bennofs1> mbw: i think explicit export lists would be enough, no need for explict import lists
16:36 <bennofs1> mbw: then ghc's warnings should tell you which functions are unused
16:37 <mbw> Ok, I'll try that.
16:37 <merijn> mbw: If you compile with -Wall and use explicit export lists for modules you should get warnings
16:39 fendor joined
16:39 <Mugwump_> So if I'm installing stack, I can't use the cabal packages ?
16:39 <mbw> Also, I have some expressions which look like "reduceTerm (TermPD g p d) = TermPD g <$> reduceElement p <*> reduceDiracDelta d", all of which are of type a -> Maybe a. While I could introduce a Reducible class or something, I feel like such a simple pattern should already exists, no?
16:39 <mbw> *exist
16:40 ragepandemic joined
16:41 coltfred_ joined
16:41 akhov joined
16:42 jmelesky joined
16:42 endymi0n joined
16:44 sgflt joined
16:44 <byorgey> Mugwump_: no, stack explicitly works with cabal packages
16:44 travula joined
16:44 Levex joined
16:44 conal joined
16:44 mizu_no_oto_work joined
16:44 Deide joined
16:45 gcross_ joined
16:45 ertes joined
16:45 Kreest__ joined
16:46 sellout- joined
16:46 enitiz joined
16:47 <lyxia> mbw: this is a bit like recursion-schemes, though I'm not sure whether it handles mutually recursive types well.
16:47 phyrex1an joined
16:47 tommd joined
16:47 V3 joined
16:48 wtetzner joined
16:48 defaultnick joined
16:49 _sg joined
16:50 <mbw> I'll just go with the most obvious solution, without trying to be fancy.
16:50 owiecc joined
16:50 Guest38728 joined
16:52 coot joined
16:52 handlex joined
16:52 bobsonu joined
16:52 zar joined
16:53 <bobsonu> There's a lot of spam on https://www.haskell.org/news as a result of subscribing to Haskell-Cafe. Who can I report this to?
16:54 robotroll joined
16:55 Sonolin joined
16:55 <lyxia> bobsonu: there's a link to https://github.com/haskell-infra/hl at the bottom
16:55 zdenal joined
16:55 defaultnick___ joined
16:55 trism joined
16:55 <lyxia> https://github.com/haskell-infra/hl/issues/204
16:56 sid_fules joined
16:56 albertid joined
16:57 <bobsonu> lyxia: Thanks.
16:57 sid_fules joined
16:57 Rainb joined
16:57 <lyxia> yw
16:58 tabaqui1 joined
16:59 <tabaqui1> is there any lib provided low-level select/poll functions
16:59 <tabaqui1> except of epoll and async
16:59 <tabaqui1> async based on threaded and gain no additional speed
17:00 <tabaqui1> epoll looks suspicios because of short history
17:00 <tabaqui1> *suspicious
17:03 GK___1wm____SU joined
17:03 mbw joined
17:04 <ertes> TIL: if Integer is not possible, haskell defaults to Double
17:06 <mbw> Ok I tried finding dead code with explicit export lists, and recompiling with Weverything. However, not a single unused-warning came out of that...
17:06 <Squarism> can i set requirements on a type class type member?
17:07 <tabaqui1> Squarism: usually you don't need it, but you can look at gadt
17:08 <tabaqui1> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#datatype-promotion
17:08 <Squarism> like : class MyClass a ; type SomeType a deriving (Eq)
17:08 handyc joined
17:08 <Squarism> oh forgot where
17:08 unK_ joined
17:08 handyc left
17:08 <tabaqui1> ehm, what do you want?
17:08 Jacoby6000_ joined
17:09 <mbw> Wait, I probably did it wrong.
17:09 <Squarism> That "SomeType a" derives Eq
17:09 yyyyy joined
17:09 handyc joined
17:09 <mbw> Does finding dead code only work if I export only used functions? That would require me to know which functions are used, and which not, in the first place ...
17:10 ccomb joined
17:10 GK___1wm____SU joined
17:11 <glguy> If everything is exported, then everything is used
17:12 defaultnick__ joined
17:13 <mbw> oh man
17:14 replay joined
17:14 <mbw> Than it would be more sensible to start with an empty import list, fill it as required and make an export list out of it...
17:14 <mbw> This should be automated.
17:14 GK___1wm____SU joined
17:14 bennofs joined
17:15 osa1 joined
17:15 osa1 joined
17:16 marfoldi joined
17:16 danharaj joined
17:17 kosorith joined
17:18 jbalint joined
17:18 jbalint joined
17:21 defaultnick__ joined
17:22 hazmat__ joined
17:23 whaletechno joined
17:23 <glguy> Squarism: class Eq (SomeType a) => MyClass a
17:24 cdg_ joined
17:24 <Squarism> glguy, oh ok thanks
17:24 <EvanR> mbw: there are some IDE plugins that manage that stuff for you
17:25 <napping> mbw: there's -ddump-minimal-imports
17:28 cpennington joined
17:29 oleksiyp joined
17:29 GK___1wm____SU joined
17:29 defaultnick__ joined
17:30 schjetne joined
17:30 GK___1wm____SU joined
17:30 <mbw> That seems helpful. Manually managing import/export lists seems like a n^2 problem.
17:31 cinimod joined
17:31 path[l] joined
17:32 fizruk joined
17:32 hvr joined
17:32 hvr joined
17:33 angelos joined
17:33 Lord_of_Life joined
17:33 Luke joined
17:34 defaultnick joined
17:36 watabou joined
17:36 avn joined
17:37 avn_nb joined
17:39 fendor joined
17:39 patbecich joined
17:41 xpkill23 joined
17:41 rios joined
17:43 cxdf joined
17:43 jathan joined
17:46 bennofs joined
17:47 conal joined
17:47 michaelw joined
17:48 luis3m left
17:48 robertkennedy joined
17:49 Zekka joined
17:49 jathan joined
17:50 Levex joined
17:50 sidei joined
17:52 Rainb joined
17:52 <Squarism> if class "Cls z" defines type "MemType z" if i somewhere have a function "f" that takes a type argument "y" that requires a Cls instance. Ie "f :: (Cls b) => b -> Int" . Can i use (MemType b) in the arguments list of f?
17:52 paolino joined
17:52 <Squarism> ops.. "." after "MemType z"
17:54 <Squarism> Something along the lines of : "f :: (Cls b) => b -> *MemType b* -> Int"
17:54 <Squarism> *...* to show idk how to write it
17:55 ramzifu joined
17:55 a3Dman joined
17:56 <glguy> What happened when you tried?
17:57 tdkqup joined
17:59 marsam joined
17:59 <Squarism> "Cls b" defines a method "gimmeMemType :: ... -> MemType b". Compiler complains theres 2 variants of MemType b ( MemType b and MemType b1) around - so cant do operations between them
17:59 nshepperd joined
17:59 ragepandemic joined
18:00 <Squarism> i tried google i promise
18:00 <Forkk> It seems like my ghc is taking an unusually long time compiling, and using more cpu than usual.
18:00 <Forkk> I used to be able to compile the entire codebase in the time it takes to compile a single module
18:00 <glguy> Squarism: Put your code and error message on lpaste then
18:01 angelos joined
18:01 alanb99 joined
18:01 mdtusz joined
18:01 alanb99 left
18:02 fendor joined
18:03 Jacoby6000__ joined
18:03 defaultnick___ joined
18:03 <Squarism> Yes i know, my code is horrible - but im learning. http://lpaste.net/353292
18:05 OnkelTem joined
18:05 <glguy> Squarism: incidentally, Ord (PlayerPos a) implies Eq (PlayerPos a)
18:05 <Squarism> Line 140 (in file) == 36 in paste
18:05 TxmszLou joined
18:06 <Squarism> oh ok
18:07 mizu_no_oto_work joined
18:07 tomphp joined
18:07 Detrumi joined
18:08 suica joined
18:09 <glguy> Squarism: It's going to be hard to guess since you didn't include many definitions or types. There are two issues to understand with a line like this, however:
18:09 <glguy> let faction = ((toPos _gc_gp gc) (_p_faction p)) :: (PlayerPos a)
18:09 ub joined
18:09 <glguy> you're saying that faction has the type 'forall a. PlayerPos a'
18:09 <suica> has anyone read this post? https://lukepalmer.wordpress.com/2008/05/02/enumerating-a-context-free-language/ the core of it seems to be this function (http://lpaste.net/353293) but I'm seriously struggling to figure out what it's doing
18:09 <glguy> 1, that's probably not what you meant and also 2, it won't work if you did meant that because PlayerPos being a type family
18:10 <glguy> you won't be able to determine what type 'a' ever is
18:10 <glguy> Squarism: Maybe you thought that the 'a' there were the same as the one in the type signature for doEndgame? In that case you'll need to enable ScopedTypeVariables, and add explicit forall a the the type signature that introduces a
18:10 defaultnick__ joined
18:11 <Squarism> glguy, Yes i thats what i hoped. Thanks for the advice. Ill work on that
18:14 <Squarism> glguy, thanks for your advice. Now it works
18:14 danharaj joined
18:14 Levex joined
18:15 fendor joined
18:16 pantsman_ joined
18:18 nadirs joined
18:18 mizu_no_oto_work joined
18:19 caumeslasal joined
18:20 GK___1wm____SU joined
18:20 ner0x652 joined
18:21 obadz joined
18:21 oish_ joined
18:22 danthemyth joined
18:22 cyborg-one joined
18:23 pera joined
18:23 freechips joined
18:24 defaultnick__ joined
18:24 GK___1wm____SU joined
18:25 guampa joined
18:26 Luke joined
18:28 wraithm joined
18:28 dhil joined
18:29 kuba-orlik joined
18:29 Swizec joined
18:29 <kuba-orlik> Hi! I'm trying to create a simple recursive function in Haskel, with two "special cases". Here's what I started with and had already failed: http://pastebin.com/rVCQPj5F What am I doing wrong?
18:30 <byorgey> kuba-orlik: you can't define a function by cases by writing each case on a separate line at the ghci prompt.
18:31 <byorgey> kuba-orlik: your second line actually completely redefined a.
18:31 <byorgey> kuba-orlik: just put the first two lines in a .hs file and then :load it into ghci.
18:31 fendor joined
18:32 <kuba-orlik> byorgey: thank you!
18:32 <byorgey> sure!
18:32 Levex joined
18:33 defaultnick__ joined
18:34 quchen joined
18:34 arkasis joined
18:34 zygentoma joined
18:34 deepfire joined
18:35 refold joined
18:35 <codedmart> I am seeing this error every so often in development. Doesn't seem to cause problems in production as far as I can tell. `Left thread blocked indefinitely in an MVar operation`. This is a servant api I have been working on. I know this is vague but any initial ideas where to look?
18:36 skeuomorf joined
18:37 watabou joined
18:37 mekeor joined
18:37 FullyFunctional left
18:38 <napping> is "Left" the name of a thread?
18:38 <dolio> I don't know servant, but that is GHC detecting some sort of deadlock.
18:38 <napping> or an Either constructor?
18:38 <dolio> Either threads blocking on each other, or a thread blocking on an empty mvar that's been garbage collected, or something along those lines.
18:39 <napping> It sounds like you're catching the exception somehow - it's Control.Exception.BlockedIndefinitelyOnMVar
18:39 <dolio> Maybe the way you're setting up your dev environment leads to this.
18:40 sena_kun joined
18:40 patbecich joined
18:41 steeze joined
18:43 jomg joined
18:43 <sena_kun> hi, guys. I want to quickly start an openshift(redhat's paas) cartridge with haskell(scotty, to be precise), but https://wiki.haskell.org/Web/Cloud#OpenShift - links from here are dead and hence I cannot. What is the current practice of openshift+haskell usage, do I need to set up everything from scratch?
18:44 sobaken_ joined
18:44 Levex joined
18:46 <sena_kun> I mean links to manifests, i.e. https://jenkins-accursoft.rhcloud.com/userContent/scotty.yml
18:46 rcsole joined
18:47 novakboskov joined
18:49 pera_ joined
18:49 <Forkk> is it possible to profile C code called from haskell? I added -pg to c-options, but it didn't seem to do anything
18:50 <novakboskov> what is ".." within constructor in pattern matching and how it's differ from "_"?
18:51 <geekosaur> Forkk, you'd need to rebuild ghc with C profiling enabled
18:51 <byorgey> novakboskov: I'm not sure what you're referring to, can you give an example?
18:51 <davean> Forkk: I don't know a good answer to your question (I've never looked) but you can definately do it with something like oprofile
18:52 <Forkk> geekosaur: as in recompile ghc?
18:52 sid_fules joined
18:52 <geekosaur> since part of it is implemented by syscalls made by the profiling C runtime
18:52 coot joined
18:52 <sena_kun> novakboskov, if you mean something like "Person{..}", then it is an extension. See https://ocharles.org.uk/blog/posts/2014-12-04-record-wildcards.html
18:53 <novakboskov> byorgey: for example "tag (Leaf ..) = 1" from http://apfelmus.nfshost.com/articles/monoid-fingertree.html
18:54 <byorgey> novakboskov: hmm, that is either a typo or it is supposed to indicate that something has been left out. It is not valid Haskell.
18:54 <geekosaur> that is metasyntax, as I read it
18:55 <byorgey> yeah, I think you're right. It means "some other stuff goes here but it doesn't matter what it is"
18:55 <geekosaur> as byorgey says, means they left something irrelevant out
18:55 <novakboskov> sena_kun: It doesn't look like that but I'll take a look at post
18:55 <sena_kun> novakboskov, nope, my answer is incorrect then. :) Please refer to what others said.
18:56 roconnor joined
18:56 oisdk joined
18:56 <Forkk> so how would one enable C profiling in ghc
18:56 <geekosaur> I don't know, since ghc's build system is fairly complex
18:57 Levex joined
18:57 <novakboskov> byorgey: Thanks! :)
18:58 <byorgey> novakboskov: sure!
18:58 ciniglio joined
18:58 <byorgey> novakboskov: that is a really cool article, hope you're enjoying it =)
18:58 deepfire joined
18:58 danthemyth joined
18:58 <geekosaur> also I suspect compiled Haskell code will confuse most C profilers, since part of the work is done by profile(3) (profile(2) on non-Linux Unixlikes) and can't distinguish the two
18:58 doomlord joined
18:59 danthemy_ joined
19:00 <geekosaur> hm, actually BSDs /OS X look to do something completely different, likely dtrace-related. even more fun.
19:01 defaultnick joined
19:01 _sg joined
19:02 HarveyPwca joined
19:03 Levex joined
19:04 Nuub joined
19:04 Cale joined
19:04 _sg joined
19:06 tommd joined
19:06 pikajude joined
19:06 Mike_G left
19:07 <kuribas> geekosaur: You want to profile which c functions the c code calls?
19:07 <mniip> Cale: *wave*
19:07 <kuribas> erm Forkk, not geekosaur
19:07 <Cale> Hey mniip, thanks!
19:08 <Cale> I don't know why Sigyn hates me lately.
19:08 <Forkk> all I want to profile is my own C code
19:08 <Forkk> with the complication that it's not standalone, since it was written to speed up part of a haskell program
19:10 <kuribas> Forkk: Could you profile in without haskell? Perhaps extracting the important bits?
19:10 <Forkk> not without writing lots of code
19:11 <Forkk> the C code is a virtual machine for a programming language that's mostly implemented in haskell
19:11 <Forkk> there's no way of serializing the "bytecode"
19:12 novakboskov left
19:12 <kuribas> why not?
19:13 guampa joined
19:16 TheEpsylon` joined
19:17 edsko joined
19:17 Noldorin joined
19:17 oleksiyp joined
19:18 bwbg_ joined
19:20 simendsjo joined
19:20 lukaramu joined
19:21 sellout- joined
19:21 Adeon joined
19:22 cdg joined
19:23 cloudhead joined
19:23 GK___1wm____SU joined
19:23 mizu_no_oto_work joined
19:23 <mniip> Cale, no idea
19:25 vF3hNGxc47h8 joined
19:25 sw4n joined
19:25 dustmote_ joined
19:26 igniting joined
19:27 stelleg joined
19:27 Luke joined
19:29 owiecc joined
19:29 contiver_ joined
19:29 skeuomorf joined
19:31 doodlehaus joined
19:32 owiecc joined
19:35 andrei_chifa joined
19:36 halogenandtoast joined
19:36 rixile joined
19:36 govg joined
19:37 insitu joined
19:37 cpennington joined
19:37 watabou joined
19:38 marfoldi` joined
19:39 sobaken joined
19:39 Miroboru joined
19:39 FullyFunctional joined
19:40 <kuribas> It seems returning a tuple is quite bad for numerical code.
19:40 <kuribas> because haskell holds on to unevaluated thunks.
19:42 <napping> are you compiling with optimizations?
19:42 patbecich joined
19:42 <blackdog> kuribas: could make it a strict tuple, a la https://hackage.haskell.org/package/strict-0.3.2/docs/Data-Strict-Tuple.html ?
19:43 path[l] joined
19:43 <kuribas> napping: yes
19:43 <Cale> Or just make sure that you cause the evaluation of the parts to happen before forming the pair
19:43 <kuribas> blackdog: yeah, now I use `seq`,which works also.
19:43 <Cale> yeah
19:43 obadz joined
19:43 <napping> If the tuple is immediately used by the caller it should be optimized away pretty well
19:44 <sternmull> Forkk: Have you tried CodeXL Intel Prallel Studio or something like that? As long as your C code is compiled with debug symbols it should not matter if it is called from haskell or something else.
19:44 igniting joined
19:44 <kuribas> napping: only if inlined...
19:44 <napping> There's also unpacked tuples, but I'm not sure what triggers that
19:44 Levex joined
19:45 <m4lvin[m]> deleting or overwriting a candidate on hackage seems broken, can someone help?
19:45 <shapr> Forkk: make a quickcheck instance for your bytecode, or run it with smallcheck or something?
19:45 <Forkk> sternmull: well I'm running Linux, so I don't know if I can use that
19:45 <Cale> m4lvin[m]: I probably can't help, but what's going on?
19:46 <sternmull> Forkk: Of course. Both are cross platform.
19:46 cdg joined
19:46 <m4lvin[m]> i uploaded https://hackage.haskell.org/package/HasCacBDD-
19:47 carlomagno joined
19:47 <m4lvin[m]> now i tried to fix that warning, but it ignores the new tar.gz that i upload
19:47 Ch3ck joined
19:47 <m4lvin[m]> which is strange, because i did replace the candidate before and then it worked
19:47 <ertes> kuribas: you get the best performance by using a strict, monomorphic tuple type
19:47 <Cale> Do you see that maintain link at the top?
19:48 <Cale> Do those options work for you?
19:48 <kuribas> ertes: ok. What do you recommend?
19:48 <ertes> kuribas: alternatively you can use CPS with appropriate inlining
19:48 TxmszLou joined
19:48 <Cale> Or is that specifically what's not working? :)
19:48 <sternmull> Forkk: For a rough idea what takes the most time it often helps to just manually pause the process with gdb and see what is executed at the moment. If you have code that eats 90% of your execution time then you probably will be in this stacktrace.
19:48 connrs joined
19:48 <kuribas> ertes: unboxed tuples?
19:48 <Forkk> fair enough
19:49 <m4lvin[m]> yes, and there is a delete link but if i use that button it says package not found, No such package in package index
19:49 <ertes> kuribas: strict, monomorphic tuples are unboxed by default in recent GHCs
19:49 twanvl joined
19:49 <Forkk> I'll probably just do that then, since it seems easiest lol
19:49 <ertes> unfortunately polymorphic tuples don't seem to work for that, even if the type is statically known
19:49 <ertes> which is really unfortunate =)
19:49 <dolio> I don't think that's accurate.
19:50 <sternmull> its the poor mans sampling profiler :)
19:50 <dolio> Unless there have been regressions.
19:50 <Cale> m4lvin[m]: If all else fails, probably uploading a new candidate with a different version number will work -- I would hope. But maybe someone closer to the hackage project will have a better idea.
19:52 <m4lvin[m]> Cale: ok, I might try that later. I was hoping to avoid bumping the number already before my first release and thought candidates are a safe playground ;-)
19:52 cyborg-one joined
19:52 <ertes> dolio: talking to me?
19:54 <dolio> Yeah. Polymorphic tuples get turned into unboxed tuples.
19:54 integral joined
19:54 integral joined
19:55 takle joined
19:56 <ertes> dolio: does that also happen for product types in general?
19:56 <dolio> Probably.
19:56 magicman joined
19:57 <dolio> I guess what might not work is having the contents of those tuples get unboxed.
19:58 oisdk joined
19:58 <ertes> dolio: i'll see if i can verify that, because cocreature made me aware that types as those in the 'linear' package (data V2 a = V2 !a !a) don't get unboxed in general, and a benchmark actually confirmed it
19:58 conal joined
19:58 <Cale> m4lvin[m]: I thought so too...
19:58 andrei_chifa joined
19:59 <Cale> m4lvin[m]: Seems odd that you can't just delete it and upload another -- perhaps a bug
19:59 mbw joined
20:00 <cocreature> ertes: I’m more than happy to be proven wrong here :)
20:00 <dolio> ertes: Anyhow, there's a worker-wrapper transform that turns an (a,b) return into an (# a, b #) return and a wrapper from (# a, b #) into (a,b). Then if the wrapper gets inlined it can disappear.
20:00 <m4lvin[m]> seems it just does not get deleted, i can still download the tar.gz again ;-)
20:01 <dolio> The problem is then that there's no further worker-wrapper that will unbox a and b.
20:01 <mbw> > sortOn length [[1..5], [1..4], [1..3]]
20:01 <dolio> ertes: Maybe the bangs interfere with that worker-wrapper transform. Not sure.
20:01 <lambdabot> [[1,2,3],[1,2,3,4],[1,2,3,4,5]]
20:02 <mbw> How can I do this "the other way round", without applying reverse?
20:02 wraithm_ joined
20:03 Denommus joined
20:04 prohobo joined
20:04 oisdk joined
20:04 <lyxia> > sortOn (Down . length) [[1..3], [1..4], [1..5]]
20:04 <ertes> dolio: yeah, that sounds reasonable… i wonder if regular non-strict fields would be better, at least for use-cases like most of mine, where i store multiple V2s in an unboxed vector rather than some other structure
20:04 <lambdabot> [[1,2,3,4,5],[1,2,3,4],[1,2,3]]
20:04 hmachado joined
20:04 ziocroc joined
20:04 nomotif joined
20:04 <kuribas> :t Down
20:05 <lambdabot> a -> Down a
20:05 <kuribas> neat
20:05 fre2 joined
20:05 <geekosaur> newtype wrapper for Monoid instances that reverses the parameters
20:05 meoblast001 joined
20:05 <geekosaur> s/reverses/swaps/
20:06 <mbw> I haven't gotten that to work :( I tried something like sortOn length (Down <$> ls).
20:06 Denommus` joined
20:06 peterbecich joined
20:06 <mbw> What terrible English...
20:07 <lyxia> geekosaur: You mean Dual?
20:07 <geekosaur> I may have it confused, still working on first coffee. probably ought to back away from kb for a bit
20:07 sid_fules joined
20:07 <lyxia> mbw: I just did.
20:07 <mbw> > getDual $ sortOn length [[1..5], [1..4], [1..3]]
20:08 <lambdabot> error:
20:08 <lambdabot> • Couldn't match expected type ‘Dual a’
20:08 <lambdabot> with actual type ‘[[Integer]]’
20:08 takuan joined
20:08 <mbw> > getDual $ sortOn length (Dual <$> [[1..5], [1..4], [1..3]])
20:08 <lambdabot> error:
20:08 <lambdabot> • Couldn't match expected type ‘Dual a’
20:08 <lambdabot> with actual type ‘[Dual [Integer]]’
20:08 <lyxia> mbw: you want to apply Dual to the thing being compared, i.e., the length.
20:08 <lyxia> hence sortOn (Down . length)
20:08 <lyxia> Down I mean
20:08 <mbw> > fmap getDual $ sortOn length (Dual <$> [[1..5], [1..4], [1..3]])
20:08 <mbw> should work.
20:08 electrostat joined
20:08 <lambdabot> [[1,2,3,4,5],[1,2,3,4],[1,2,3]]
20:09 <mbw> But Down is more idiomatic I guess?
20:10 <lyxia> sounds like an accident
20:10 <lyxia> Dual is not what you want
20:10 <lyxia> > fmap getDual $ sortOn length (Dual <$> [[1..3], [1..4], [1..5]])
20:10 <lambdabot> [[1,2,3],[1,2,3,4],[1,2,3,4,5]]
20:10 <mbw> oh
20:11 <mbw> nasty
20:11 <lyxia> > length (Dual [1,2,3]) -- Dual is Foldable.
20:11 <lambdabot> 1
20:11 <mbw> So how does Down work, does it have a special Ord instance?
20:11 <lyxia> yes, it just flips the arguments of compare
20:13 oish_ joined
20:14 <mbw> I better figure out how compare/comparing/sortBy/sortOn/... work. But at least I have a working solution. Thanks!
20:15 prohobo left
20:15 paolino joined
20:15 defaultnick__ joined
20:15 peterbecich joined
20:17 afarmer joined
20:17 Levex joined
20:19 pera joined
20:19 srbaker_ joined
20:20 <mbw> Also, I had to implement a groupBy function, which grouped all occurences of an item, such that concat . group $ "Mississippi" /= "Mississippi", but "Miiiisssspp". There should be a standard way to do this as well, right?
20:20 <m4lvin[m]> Cale: Now overwriting works :-) Maybe the old one was just cached somewhere?
20:20 ilja_kuklic joined
20:20 <pikajude> mbw: group just uses adjacent elements
20:20 <pikajude> you'd want to use a Map or a Set or something for that
20:21 <mbw> I need the duplicates, and just need to reorder a list.
20:22 yyyyy left
20:22 <mbw> No matter, it's a one-liner anyway.
20:22 <pikajude> if you need to reorder it, just sort
20:23 <mbw> How would you apply sort such that sortBy _something "Mississippi" == "Miiiisssspp"?
20:23 <mbw> I don't think that will work.
20:23 ragepandemic joined
20:24 xcmw joined
20:24 <pikajude> i'm not sure what you're using exactly
20:24 <pikajude> but for me, just `sort` works
20:24 <pikajude> > sort "Mississippi"
20:24 <lambdabot> "Miiiippssss"
20:24 <pikajude> unless you really want the s and the p to be reversed?
20:24 <blackdog> he's clearly trying to sort by bendiness
20:24 <geekosaur> you want to swap just the klast two?
20:24 <geekosaur> or... what is the rule here?
20:24 <mbw> lol
20:24 <pikajude> that's not really sorting then
20:24 <pikajude> you could put a newtype wrapper on Char
20:25 <geekosaur> it's sorting, certainly, but not by one of the common rules
20:25 <jophish> I think mbw wants to sort on the first index at which an item can be found
20:25 <pikajude> that's not really sort either is it
20:25 <pikajude> that's group
20:26 <geekosaur> yeh
20:26 <pikajude> that would be a bit more complicated but i think it would only be a few lines
20:26 <kuribas> The profiler says most of the time is spend in modify, but modify is actually optimized away. How is that possible?
20:26 <blackdog> yeah, i think two passes is easiest - dump it into a Map Char Int, then map a function over (uniq str)
20:27 <geekosaur> the inlined modify is forcing thunks?
20:27 <jophish> > (\l -> sortOn (`elemIndex` l) l) "Mississippi"
20:27 <lambdabot> "Miiiisssspp"
20:27 deepfire joined
20:27 <blackdog> jophish: hahaha, that's cute. slow though, surely?
20:27 <blackdog> maybe that doesn't matter.
20:27 wraithm joined
20:27 pasukon joined
20:27 <jophish> I don't care :D
20:28 <mbw> Sorry, that was a type error, I want ["M","iii",...]. What I got is http://lpaste.net/353295, and it works.
20:28 <jophish> D:
20:28 <pikajude> map snd . concat . sortBy (comparing (fst . head)) . groupBy ((==) `on` snd) . sortBy (comparing snd) . zip [0..]
20:28 <mbw> I just thought that would be a "standard" problem...
20:28 <pikajude> it's perfect!
20:28 <mbw> haha
20:28 <kuribas> geekosaur: maybe?
20:28 <jophish> "a → a → 𝔹", nice
20:29 richardcq joined
20:29 <mbw> That's actually a vim plugin, I turn it off most of the time.
20:29 <pikajude> :t sortOn =<< flip elemIndex
20:29 <lambdabot> Eq a => [a] -> [a]
20:29 <pikajude> there you go. very idiomatic
20:30 <Bish> why is list a monad :o
20:31 kh4| joined
20:31 <blackdog> because the instance fulfils the laws
20:31 <pikajude> because you can write bind, join, and return
20:31 <pikajude> or whatever the laws are
20:31 <mbw> Also, list comprehensions can be defined in terms of the monad instance.
20:32 <Bish> this stuff is all confusin
20:32 <mbw> the sortOn flip elemIndex is pretty, I'll use that. My program is convoluted enough at this point.
20:33 <blackdog> Bish: can be when you're thrown into it. Are you comfortable with functor & applicative yet? monad feels a bit more obvious & motivated once you understand them.
20:34 Sh4pe joined
20:34 jbiesnecker joined
20:34 <Bish> blackdog: no i am not comfortable at all :D with haskell, but i'd like to
20:34 <jophish> Anyway, that's not the list monad, that's the monad instance for (->) e
20:35 <jophish> oh, that was probably two unrelated conversations
20:35 Levex joined
20:35 <geekosaur> Bish, in some ways list is the canonical monad, because it maps directly to the underlying concepts. haskell bind is join . fmap, list join is concat, list fmap is map
20:36 <ertes> Bish: why is (+) on Integer a monoid?
20:36 <blackdog> Bish: it's probably best to find yourself a book and work through it. i like haskellbook.com, but i'm sure there are other good ones.
20:36 <richardcq> Hi guys, I'm having trouble figuring out how to make a function designed to run within the context of the redis monad. Essentially, I just want to loop in the monad with an accumulated list and then bind it from outside the monad, but I can't even figure out what the type of the function is and it's kinda blowing my mind
20:36 xpkill23 joined
20:37 <Bish> ertes: can rhetorical questions help people understand?
20:37 rperry joined
20:37 <ertes> Bish: sometimes, but this one is not rhetorical
20:37 <Bish> blackdog: maybe i'll have to
20:38 <geekosaur> and the list monad is (a) what underlies list comprehensions (b) useful for finding all possible solutions to something (we generally call this usage the "nondeterminism monad")
20:38 <ertes> Bish: consider it an actual exercise, even if the answer seems trivial
20:38 <Bish> ertes: ofc it is, because you don't want the answer
20:38 <geekosaur> or sometimes the "logic monad" --- see LogicT
20:38 <ertes> Bish: yes, i do
20:38 <Bish> ertes: doesn't make the question non-rhetorical
20:38 watabou joined
20:38 <ertes> Bish: ok, let's go with it being rhetorical… in that case the question why [] is a monad is also rhetorical =)
20:39 defaultnick__ joined
20:39 jao joined
20:39 <ertes> Bish: monoids are a simpler example to grasp that kind of abstraction, before you go to monads
20:40 xcmw joined
20:40 Textmode joined
20:40 louispan joined
20:42 <EvanR> functors are even simpler
20:42 <ertes> Bish: the most important question about Monoid (the type class) is perhaps: why is it useful? answer: because there are at least two instances, and because you can abstract over it (e.g. mconcat or foldMap)
20:42 srbaker_ joined
20:42 <mbw> Functors and Monoids are like Mozart. Too easy for beginners, too hard for the pros.
20:43 <Bish> ertes: im not looking for cooler questions, im looking for the answer to my original question, your questions making it worse ;)
20:43 <Bish> better question maybe; why can't a list be a "value" like: 1
20:43 defaultnick__ joined
20:43 fosskers joined
20:43 patbecich joined
20:44 <ertes> Bish: lists *are* values
20:44 <ertes> but the [] type itself isn't
20:44 <* dminuoso> pokes Bish
20:44 <dminuoso> New language to toy with? :-)
20:44 <ertes> Bish: but i think you're trying to see more than there is =)
20:44 <pikajude> isn't [] a type function, not a type
20:44 machbio joined
20:44 <Bish> ertes: thanks your answer that one helped already
20:45 <ertes> Monad is just like Monoid in that respect: it's a set of laws, it has at least two instances, and you can abstract over it (e.g. replicateM)
20:45 <Bish> dminuoso: languages is the most fun thing there is in cs, always in search for the holy grail
20:45 <ertes> > replicateM 4 "01"
20:45 <Bish> these abstract explanation don't help me (yet)=
20:45 <lambdabot> ["0000","0001","0010","0011","0100","0101","0110","0111","1000","1001","1010...
20:45 peterbecich joined
20:45 ramzifu joined
20:45 <pikajude> monoid is very useful
20:45 <Bish> i need to be taught these like im stupid, or i will have just to try it out / read a book
20:45 <dminuoso> Bish: The holy grail is still Malbolge. If you write a Quine in malbolge you are a true saint.
20:46 peterbec` joined
20:46 <mbw> Bish: Do you know what a vector is?
20:46 <dminuoso> If you can do it, I become religious.
20:46 defaultnick__ joined
20:46 peterbec` joined
20:46 <Bish> dminuoso: was it that thing that got designed so it IS complicated?
20:46 <ertes> dminuoso: malbolge is quite boring actually… i language that is difficult by design (rather than by arbitrary restrictions) would be lazy k
20:46 <pikajude> yeah
20:46 <ertes> *a
20:47 fnurglewitz joined
20:47 <dminuoso> Bish: Yes. And it's still not clear whether it's turing complete. ;o
20:47 <ertes> malbolge is like the PHP of esoteric programming languages
20:47 <Bish> yeah but that is just stupid :D
20:48 Luke joined
20:48 <pikajude> any sequence of 0s and 1s is a valid jot program
20:49 oisdk joined
20:49 <dminuoso> Bish: Oh actually malbole is not turing complete due to an inherent limitation of supporting only 59049 malbolge instructions for a given program.
20:49 t0by joined
20:49 t0by joined
20:50 <shapr> Bish: have you tried haskellbook.com? It builds from functor to applicative to monad; you may find that easier.
20:51 dmwit_ joined
20:52 soLucien joined
20:53 <Bish> shapr: yea i won
20:53 <Bish> 't get around that i guess
20:53 insitu joined
20:54 defaultnick_ joined
20:54 CurryWurst joined
20:55 ikke joined
20:55 mdarse joined
20:56 ystael joined
20:56 suica joined
20:57 <maerwald> shapr: is it still non-free?
20:57 <shapr> it is, but also totally worth the money.
20:58 <maerwald> then I would rather recommend free alternatives that do the same: yorgeys cis course
20:58 <shapr> @where cis194
20:58 <lambdabot> http://www.seas.upenn.edu/~cis194/spring13/
20:59 <shapr> Bish: try this -> http://www.seas.upenn.edu/~cis194/spring13/lectures.html
21:00 sid_fules joined
21:01 jbiesnecker joined
21:03 Copperis joined
21:08 tag joined
21:08 CurryWurst joined
21:09 peterbec` joined
21:09 pera joined
21:09 peterbec` joined
21:10 CurryWurst joined
21:11 jbiesnecker joined
21:11 afarmer joined
21:12 t7 joined
21:13 V3 joined
21:15 patbecich joined
21:15 CurryWurst joined
21:16 Koterpillar joined
21:16 thewickedaxe joined
21:19 <sternmull> i start ghci with -fbreak-on-error and run a toy function that results in an exception with :trace. When i then do :list it says "Unable to list source for <unknown>, Try :back then :list". If i do :back and :list then i am "one step away" from the expression that causes the exception. Is there a way to the exact point that caused the exception?
21:20 acarrico joined
21:21 mr_sm1th joined
21:21 baldrick joined
21:21 <geekosaur> sternmull, that will happen if the exception happened inside a compiled function (e.g. something from the Prelude)
21:22 CurryWurst joined
21:22 biglama joined
21:24 <sternmull> geekosaur: I let div throw by calling f 3 where "f i = div 100 i : f (i - 1)". And then :history can only show me "i - 1" with i = 1 as last useful thing.
21:25 mdtusz joined
21:25 silver_ joined
21:26 <sternmull> i had expected it to at least tell me that the exception is thrown in "f 0".
21:26 CurryWurst joined
21:26 andrei_chifa joined
21:27 marfoldi joined
21:27 oisdk joined
21:28 wraithm joined
21:28 CurryWurst joined
21:30 replay joined
21:30 sellout- joined
21:31 <geekosaur> that's what the ":back" is suppsoed to do but sometimes you need to repeat it to get to the right frame
21:32 <ertes> could someone recommend a proof assistant that has a somewhat comprehensive real analysis library? particularly calculus
21:32 <sternmull> :back makes sense. But is strange that the most current entry in the history is not valid for :list.
21:32 raynold joined
21:32 <ertes> axiomatic is good enough
21:33 JeanCarloMachado joined
21:34 CurryWurst joined
21:34 balor joined
21:35 mszczygiel joined
21:36 JagaJaga joined
21:37 Sh4pe joined
21:38 TxmszLou joined
21:38 FullyFunctional left
21:39 insitu joined
21:39 <geekosaur> sternmull, not really, gdb will do the same thing to you if you trap in a libc function
21:40 watabou joined
21:40 <Sh4pe> Hi all! I'm getting a 'pattern match(es) are overlapped' warning on this piece of code: https://gist.github.com/Sh4pe/e23cd57fdcd32aaab428cc93465f8542
21:40 <geekosaur> and depending on optimization level may confuse things even worse (ghci doesn't optimize so at least you don't have to deal with that too). also laziness means (a) things don;t always evaluate the way you expect (b) there is no true call stack (it's graph reduction)
21:40 jbiesnecker joined
21:40 <Sh4pe> Can someone tell me how I can avoid the warning?
21:41 <geekosaur> Sh4pe, you can;t match against delim that way, you must use a guard
21:41 CurryWurst joined
21:41 epsilonhalbe joined
21:41 <geekosaur> it creates a new binding named delim that hides the old one
21:41 <geekosaur> it does *not* compare the value
21:41 <sternmull> geekosaur: But then i have a stackframe that calls the libc function and see the arguments that are given to it. For my div-example i don't have the "final call of f that calls div".
21:42 sssilver joined
21:42 <Sh4pe> Oh - okay. Can you tell me how I can fix this?
21:42 <Sh4pe> (Sorry, my Haskell is not too good ;))
21:43 <geekosaur> remove the middle case and use a guard on the last one: | x == delim = concatLeft delim r | otherwise = C.concat [bsa, r]
21:44 sellout- joined
21:45 Brando753 joined
21:45 mekeor joined
21:46 defaultnick joined
21:48 dan_oneata joined
21:49 SepakoRayl joined
21:49 CurryWurst joined
21:49 bjz joined
21:50 jbiesnecker joined
21:52 ramzifu joined
21:52 MarcelineVQ joined
21:52 <SepakoRayl> is there any reason to hold state wen parsing other than error reporting? I was taking a look at Happy and I can't think of any reason to ever keep state for non-error reporting purposes.
21:52 CurryWurst joined
21:53 hiratara joined
21:54 <SepakoRayl> I mean it should be possible to retrieve most data by working on the AST
21:56 kritzcreek_ joined
21:56 CurryWurst joined
21:57 ystael joined
21:57 kuba-orlik joined
21:58 pera_ joined
21:59 <okeuday_bak> what am I doing wrong at https://github.com/okeuday/erlang_hs/blob/master/src/Foreign/Erlang.hs#L183-L185 with the Monad instance, it gives the error "Couldn't match type `PutMResult b' with `Either Error (Put.PutM b)', Expected type: Result (Put.PutM b), Actual type: PutMResult b"?
21:59 mbw joined
22:00 chilversc joined
22:00 conal joined
22:00 CurryWurst joined
22:01 <Koterpillar> okeuday_bak: what's the type of k?
22:01 SepakoRayl joined
22:02 <okeuday_bak> Koterpillar: I thought it was PutResult, but I could be wrong, I need to read more about Monads probably
22:02 <chilversc> just trying the exercises on the site, and it says to pattern match (10,"abc") to get the letter 'a', so I used let (_,a:_) = (10, "abc") in a but the site has extra parens, (_,(a:_))
22:02 sid_fules joined
22:02 wraithm joined
22:02 <chilversc> is the site just being more explicit or does leaving out the parens change it?
22:02 t_h joined
22:03 cur8or joined
22:03 <Koterpillar> okeuday_bak: it is PutResult
22:03 <Koterpillar> okeuday_bak: but what is 'k r' then?
22:03 <SepakoRayl> nvm got it
22:03 <Koterpillar> oh, sorry, 'k r' would be PutResult
22:03 CurryWurst joined
22:04 <Koterpillar> okeuday_bak: but next on, you're trying to construct PutResult (k r), where (k r) :: PutResult b
22:04 Sh4pe joined
22:04 tomphp joined
22:04 <Koterpillar> chilversc: try and find out
22:04 <chilversc> I did, I didn't notice a difference
22:05 <Koterpillar> then your guess is correct
22:05 <okeuday_bak> Koterpillar: yeah, I was attempting to use a Monad instance similar to Either, but that appears to be inappropriate because the Right side is that writer monad
22:06 <lyxia> chilversc: it's the same
22:06 <Koterpillar> okeuday_bak: is PutM a monad?
22:06 skeuomorf joined
22:06 <okeuday_bak> Koterpillar: yes, that is my understanding, it is a type of writer monad
22:07 <Koterpillar> then yours is EitherT on top of it, right?
22:07 <okeuday_bak> Koterpillar: I am not yet using EitherT, should I be instead of Either to avoid problems?
22:08 <Koterpillar> you are rewriting EitherT
22:08 <okeuday_bak> Koterpillar: k, thanks
22:09 <Koterpillar> so either go with the types, or look up how it is implemented
22:09 cdg_ joined
22:09 <okeuday_bak> Koterpillar: yeah, I will read more about it and try using it instead
22:10 wraithm joined
22:10 Micamo joined
22:11 a3Dman joined
22:14 sovreign_ joined
22:14 <mbw> Ok this has been bothering me for quite a while now. I have this kind of type hierarchy: http://lpaste.net/353296 . While my program works and does what it should, I'd like to know how to design this kind of stuff better in the future. The problem is that it would've been nice to have been able to derive Functor/Foldable/Traversable for these things. So I would pull some stuff out and bring it into a form
22:14 <mbw> that is parametrically polymorphic on one type variable. However, then I'd have to do some newtyping, probably, in order to make the resulting type signatures easier to work with. If I did it like this, it would be nice to know if there was some reasonable naming convention as well. The other possibility would of course be Lenses, but I've only just started learning about those. So, what would be a
22:15 <mbw> reasonable way to go about this, i.e. how would you refactor this code to make these data structures more "usable"?
22:16 swalladge joined
22:17 albertus1 joined
22:17 Sh4pe joined
22:18 defaultnick joined
22:18 <lyxia> your constructors have a lot of overlap
22:18 CurryWurst joined
22:19 <lyxia> Can you also paste some of the functions on these
22:20 <mbw> ok I'll try to find something representative. This might take me a moment, though.
22:21 CurryWurst joined
22:22 zar joined
22:23 Micamo joined
22:24 <mbw> Is it ok if I just dump the whole thing? I don't know specifically *where* my life would've been easier, to be honest. This whole thing just feels wrong. It's about ~300 LOC, probably less without import/export lists.
22:24 CurryWurst joined
22:25 <lyxia> 300 is okay.
22:26 <mbw> I'll trim it down and post it.
22:26 maninalift joined
22:27 steven_yvr joined
22:27 louispan joined
22:27 gugah joined
22:30 jbiesnecker joined
22:31 <lpaste_> lyxia annotated “Types” with “Factored Types” at http://lpaste.net/353296#a353297
22:31 <lyxia> mbw: ^
22:31 hiratara joined
22:31 <lyxia> it looks neater but it's not necessarily more convenient depending on what you're doing with these types.
22:31 petervaro joined
22:32 <lyxia> it is DRYer
22:32 <Tuplanolla> Is `MonadReader r n => (m a -> n b) -> ReaderT r m a -> n b` a specialization of some common function? I don't see it.
22:32 <ertes> mbw: if you abstract over the element type, i'd honestly just use the type argument
22:32 <ertes> f :: TEI Label -> TEI Label
22:32 <ertes> or even:
22:32 newbie joined
22:32 <ertes> f :: (Whatever a) => TEI a -> TEI a
22:33 <ertes> you probably don't need the actual structure of Label most of the time… knowing that it's Eq or Ord or … might be enough for many functions
22:34 <ertes> more abstraction is also a nice way to make types more documenting and functions less error-prone (due to parametricity)
22:34 <mbw> Ok: http://lpaste.net/353298
22:34 <lolisa> Hello, so I am writing a example for my library. Are there similar tools to https://github.com/tpolecat/tut in haskell?
22:34 deepfire joined
22:35 <ertes> @let data Label = A | A' | A'' | A''' | B | B' | B'' | B''' deriving (Bounded, Enum, Eq, Ord, Show)
22:35 <lambdabot> Defined.
22:35 <ertes> > [minBound..maxBound] :: Label
22:35 <lambdabot> error:
22:35 <lambdabot> • Couldn't match expected type ‘Label’ with actual type ‘[t0]’
22:35 <lambdabot> • In the expression: [minBound .. maxBound] :: Label
22:36 <ertes> > [minBound..maxBound] :: [Label]
22:36 <lambdabot> [A,A',A'',A''',B,B',B'',B''']
22:37 <mbw> The problem is that the Eq instances are "non-standard", since I make use of some symmetries. Also I find myself converting from tuples to lists and vice-versa a lot.
22:38 <mbw> Abstracting over the element type would not work for Term that easily, even in the refactored version lpaste_ suggested.
22:38 <ertes> mbw: why not?
22:39 <mbw> Wouldn't Term be a multi-param typeclass?
22:39 <ertes> class?
22:39 <ertes> Term is a type
22:40 <mbw> Ah, so you meant abstracting in function signatures only?
22:40 <lyxia> lolisa: we have literate haskell
22:40 <ertes> whether you need multiple parameters depends on over what you want to abstract
22:40 <ertes> data Term a = TermP (TEI a) (MatrixElement a) | …
22:40 <lyxia> lolisa: it's not pure markdown though
22:40 <ertes> that's Foldable, Functor and Traversable
22:41 <mbw> oh
22:41 jbiesnecker joined
22:41 krokodil joined
22:41 <ertes> (as long as TEI and MatrixElement are)
22:41 <mbw> Why didn't I think of that :(
22:41 <lolisa> that sounds great. can it generate github markdown?
22:41 watabou joined
22:42 <mbw> I was thinking strictly along the lines of Term a = TermP a | TermQ a | ...
22:42 Luke joined
22:42 <ertes> you can probably also write useful Applicative instances for a lot of those types, which gives you zipping
22:43 <mbw> hmm..
22:43 <ertes> in fact you don't even need to write those yourself, as (<*>) is defined for generic products
22:43 <krokodil> can somebody explain to me what this Stack warning means, please?
22:43 <krokodil> WARNING: The "pandoc" executable found on the PATH environment variable is /home/krok/.stack/snapshots/x86_64-linux-nopie/lts-8.4/8.0.2/bin/pandoc, and not the version that was just installed.
22:43 danvet left
22:43 <mbw> Do you mean tuples (anonymous products)? Or can I derive Applicative?
22:43 louispan joined
22:43 danvet joined
22:44 <mbw> I thought (<*>) was only trivial if I had a Monad instance already.
22:44 <lyxia> lolisa: text in literate Haskell is comments by default, and code is in special blocks, either surrounded by LaTeX-style \begin{code}/\end{code} or with lines prefixed by >
22:44 Voldenet joined
22:44 Voldenet joined
22:44 <ertes> @let import qualified GHC.Generics as Gen
22:44 <lambdabot> Defined.
22:45 <lyxia> lolisa: you can just give it to GHC, and it's pretty straightforward to convert code blocks to whatever format you want
22:45 <ertes> @let data V2 a = V2 a a deriving (Eq, Foldable, Functor, Gen.Generic, Ord, Show, Traversable)
22:45 <lambdabot> Defined.
22:45 <lolisa> got it. sounds good to me, thx
22:45 petrus joined
22:45 <ertes> @let instance Applicative V2 where pure = Gen.to . pure; fs <*> xs = Gen.to (Gen.from fs <*> Gen.from xs)
22:45 <lambdabot> .L.hs:197:29: error:
22:45 <lambdabot> • Couldn't match type ‘b’ with ‘a -> b’
22:45 <lambdabot> ‘b’ is a rigid type variable bound by
22:46 TxmszLou joined
22:46 <ertes> mbw: ^ anyway, this, but correct =)
22:47 <mbw> This is great. I haven't learned about Haskell Generics yet.
22:47 albertus1 joined
22:48 <mbw> How would you tackle the problem of having to use list functions with tuples, i.e. packing/unpacking ?
22:48 <ertes> i don't… i make sure tuples don't come up
22:49 bob3434 joined
22:50 ChaiTRex joined
22:51 defaultnick joined
22:53 <mbw> Specifically, inside "allPermutations" for example. I have a function called addPrimes, which for a given list of labels, makes sure they are all unique. I found it most reasonable to implement it with a list. But if I had worked with nested lists instead of Lists of tuples, things would've been more error-prone, probably.
22:54 <ertes> this is weird… why didn't the instance work?
22:55 ziocroc joined
22:56 <ertes> :t \xs0 -> foldr (\x go xs -> if S.member x xs then False else go (S.insert x xs)) (const True) xs0 mempty
22:56 <lambdabot> (Foldable t, Ord a) => t a -> Bool
22:56 gugah joined
22:57 albertus1 joined
22:57 <ertes> mbw: should return True if unique, False otherwise
22:57 jshjsh joined
22:57 ystael joined
22:57 cdg joined
22:59 Gloomy joined
23:00 <mbw> ertes: The thing I'm doing is more like addPrimes [A,A,A,B,B] = [A,A',A'',B,B'].
23:00 markus1189 joined
23:01 andrei_chifa joined
23:01 JeanCarloMachado joined
23:01 markus1199 joined
23:01 defaultnick joined
23:01 <mbw> I just hope I'm not talking about the wrong function here...
23:03 <MarcelineVQ> ertes: Generic1 is for * -> *
23:04 <ertes> MarcelineVQ: didn't work either, but i'm 100% sure that i've already used the generic (<*>) somewhere
23:04 jessekempf joined
23:04 <ertes> maybe i had an instance in scope i didn't realise came from somewhere outside of 'base'
23:04 path[l] joined
23:04 <MarcelineVQ> oh? it worked for me just now :X maybe mine isn't rebuilding fresh
23:04 <ertes> perhaps from the generic-deriving library or something
23:05 <ertes> OH!
23:05 <ertes> d'oh!
23:05 <ertes> @let deriving instance Generic1 V2
23:05 <lambdabot> .L.hs:195:19: error:
23:05 <lambdabot> Not in scope: type constructor or class ‘Generic1’
23:05 <lambdabot> Perhaps you meant one of these:
23:05 <ertes> @let deriving instance Gen.Generic1 V2
23:05 <lambdabot> Defined.
23:05 <ertes> @let instance Applicative V2 where pure = Gen.to1 . pure; fs <*> xs = Gen.to1 (Gen.from1 fs <*> Gen.from1 xs)
23:05 <lambdabot> Defined.
23:05 <ertes> there we go =)
23:05 defaultnick_ joined
23:05 <ertes> > pure sin <*> V2 3 5
23:06 <lambdabot> V2 0.1411200080598672 (-0.9589242746631385)
23:07 <mbw> Do people use this often? It doesn't look like it's easy.
23:07 <ertes> mbw: i use it a lot, mostly to avoid having to write Monoid instances for product types
23:07 <lyxia> pure sin looks evil.
23:08 <ertes> (which unfortunately requires the generic-deriving library, because (<>) is not defined genericly)
23:08 <ertes> haha
23:08 V3 joined
23:08 <ertes> perhaps (pure tan) looks more sunny
23:08 babu` joined
23:09 swhalen joined
23:10 jessekempf joined
23:10 <mbw> There's always something new to learn. It's a shame they use fortran where I'm at.
23:10 <freechips> hey guys
23:10 <freechips> is anybody online?
23:10 <freechips> ive got a function with matches such as string -> int
23:10 <freechips> and id like to extend it in another function
23:10 <freechips> so like i have f1 = function "a"->1 | "b"->2 | ....
23:10 peterbec` joined
23:10 jessekempf1 joined
23:11 <MarcelineVQ> I can think of worse things than fortran, that being said it might be fun to write a haskell dsl that compiles to fortran
23:11 <freechips> and id like to have f2 = (f1 + "c"->3)
23:11 <lyxia> looks like OCaml
23:11 <freechips> oh shit
23:11 <freechips> sorry guys
23:11 <freechips> wrong channel
23:11 revprez joined
23:11 <MarcelineVQ> You'll be back :>
23:11 <freechips> i will
23:12 <freechips> but i need ocaml right now
23:12 louispan joined
23:12 <freechips> im determined to switch to haskell after ocaml
23:12 <mbw> MarcelineVQ Fortran can be as nice as any language. But of course you have to read other people's code more often than write your own...
23:13 <mbw> I guess on the other hand that clusterf* I posted isn't all that pretty either I guess :)
23:14 <ertes> i can read it
23:14 <ertes> that makes it good enough, because i ha… prefer not to read other people's code most of the time =)
23:14 albertus1 joined
23:16 TheEpsylon- joined
23:16 <mbw> It's kind of hard to find a middle ground between applying obvious substitutions and maintaining readability. For instance, I'm pretty sure I won't know what reduceTerms does a month from now...
23:16 dan_f joined
23:17 conal joined
23:20 Raptor8m3 joined
23:20 TheEpsylon` joined
23:20 ChaiTRex joined
23:20 <mbw> Oh and I probably forgot, but thank you guys for your advice!
23:21 mnoonan joined
23:21 anoe joined
23:21 cmdd joined
23:21 jbiesnecker joined
23:21 mitchty joined
23:23 graygoose124_ joined
23:24 defaultnick joined
23:24 Sh4pe joined
23:24 emmanuel` joined
23:24 LiaoTao joined
23:25 tag joined
23:26 sellout- joined
23:27 Zialus joined
23:27 Gabemo joined
23:28 mitchty joined
23:28 tromp joined
23:29 moth joined
23:30 safe joined
23:30 albertus1 joined
23:30 epsilonhalbe left
23:31 jbiesnecker joined
23:35 Wizek joined
23:35 Wizek_ joined
23:36 halogenandtoast joined
23:37 <Bish> hi, this is not a strict docker question
23:38 <Bish> but are new combinations of linux/kernel docker to have a route per docker
23:38 <glguy> Oops, this is #haskell
23:38 <Bish> oy
23:38 <Bish> i thought i typed #docker
23:38 <benzrf> :D
23:38 <Bish> ./channel #docker
23:38 <glguy> the old off-by 4 error
23:38 Koterpillar joined
23:38 <Bish> nah.. i got kicked immediately :D
23:39 defaultnick__ joined
23:39 earldouglas joined
23:40 sellout- joined
23:41 jbiesnecker joined
23:43 watabou joined
23:43 mda1 joined
23:47 sid_fules joined
23:47 thewickedaxe joined
23:48 fDev2179 joined
23:48 mac10688 joined
23:48 <mac10688> So if I want to use ghcjs or purescript with yesod, how would I do this? I would just compile the purescript files and then serve them as static files?
23:49 <Koterpillar> mac10688: correct
23:49 <mac10688> that's my favorite answer. Thanks Koterpillar
23:49 <paf31> mac10688: I haven't used it, but there is https://hackage.haskell.org/package/yesod-purescript
23:50 <Koterpillar> paf31: what does that do? "All things that are "YesodPureScript master", are also this other thing, because they nobody knows, because TH."
23:50 dogweather joined
23:52 <paf31> actually it looks like it hasn't been updated in a while
23:52 ramzifu joined
23:52 <paf31> just serve static files :)
23:52 mounty joined
23:52 <mac10688> lol ok thanks paf31
23:53 daddychevere joined
23:54 Welkin joined
23:56 wtetzner joined
23:56 bernouli joined
23:57 ertes joined
23:58 ystael joined
23:59 gugah joined
23:59 cdg joined
23:59 urodna joined