<    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 <markh> update to my windows infinite list issue: i switch over to my linux VM. much better
00:02 markh joined
00:03 TxmszLou joined
00:06 aglorei joined
00:07 nakal_ joined
00:07 vadimich joined
00:07 louispan joined
00:08 <Zemyla> There should be a type class for values e for which ((->) e) is Traversable.
00:08 nighty joined
00:09 animated joined
00:10 markus1189 joined
00:10 markus1199 joined
00:12 <mpickering> Did manual documentation upload to hackage change at some point?
00:12 <mpickering> the script I used to use no longer works
00:14 hvr joined
00:14 hvr joined
00:15 <mpickering> oh I seem to be able to use cabal upload --documentation now
00:15 <mpickering> what an innovation
00:16 Rodya_ joined
00:16 dgonzo joined
00:17 lambda-11235 joined
00:18 Quintasan joined
00:18 Quintasan joined
00:19 kosmikus joined
00:19 Shatnerz joined
00:20 aglorei joined
00:20 cmn joined
00:21 pickle_ joined
00:21 lambdafan joined
00:24 aarvar joined
00:25 <lambdafan> I'm trying to do this : (Monad m) => a -> m b -> m (a -> b)
00:26 <Koterpillar> lambdafan: did you forget some brackets somewhere?
00:27 mounty joined
00:27 theDon_ joined
00:29 <c_wraith> it's not implementable with the missing parens. it is implementable like that.
00:29 <c_wraith> though only trivially.
00:30 <Koterpillar> oh, right
00:30 <Koterpillar> but doesn't look interesting either way
00:30 augur joined
00:32 binobi joined
00:32 <lambdafan> (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
00:32 <lambdafan> I'm using this operator
00:32 <lambdafan> I have two monadic actions
00:32 <lambdafan> and I end up with
00:33 <lambdafan> Monad m => a -> m c
00:33 <lambdafan> but I'd like a m (a -> c)
00:33 <c_wraith> that's what the type requires
00:33 <c_wraith> that's impossible
00:33 <marvin2> is it?
00:34 dgonzo_ joined
00:34 jdelreal joined
00:34 <c_wraith> except for specific trivial monads like identity, yes
00:34 vadimich joined
00:34 <Koterpillar> lambdafan: consider this value: \v -> if v then putStrLn("Was true!") else return ()
00:35 <Koterpillar> lambdafan: that's Bool -> IO (). If you get an IO (Bool -> ()) out of it, what would that do?
00:35 <lambdafan> ah that makes no sense
00:35 <c_wraith> marvin2, if it wasn't impossible, Applicative and Monad would be the same thing
00:36 skeet70 joined
00:36 <monochrom> Nice example, Koterpillar.
00:38 <c_wraith> Koterpillar, yes, that really is an excellent illustration.
00:38 <Koterpillar> well, I was confused in the first place <_<
00:39 <c_wraith> you recovered well. :)
00:39 sillyotter joined
00:40 markasoftware joined
00:41 augur joined
00:41 markasoftware joined
00:43 roconnor joined
00:43 louispan joined
00:46 plutoniix joined
00:47 dgonzo joined
00:48 Foras joined
00:49 newbie1 joined
00:49 whaletechno joined
00:51 eacameron joined
00:52 ramzifu joined
00:53 kafke joined
00:55 feri joined
00:56 sigmundv joined
00:58 cpup joined
00:59 _ashbreeze_ joined
01:02 rekahsoft joined
01:02 eacameron joined
01:03 Rotaerk joined
01:04 sellout- joined
01:05 <michalrus> > let 1 = 2 in 3
01:05 <lambdabot> 3
01:06 <michalrus> Could anyone point me to some resources on why the above compiles? (:
01:06 <Koterpillar> > let 1 = 2 in 1
01:06 <lambdabot> 1
01:06 <michalrus> Noes. :p
01:06 <michalrus> There’s something weird going on.
01:06 <michalrus> Also:
01:06 <michalrus> > let 1 = "blah" in 2
01:06 <lambdabot> error:
01:06 <lambdabot> • Could not deduce (Num [Char]) arising from the literal ‘1’
01:06 <lambdabot> from the context: Num t
01:07 <Koterpillar> > 2 where 1 = 3
01:07 <lambdabot> <hint>:1:3: error: parse error on input ‘where’
01:07 <Koterpillar> > let f = 2 where 1 = 3 in f
01:07 <lambdabot> 2
01:09 tom7942 joined
01:11 aglorei joined
01:12 <Squarism> is there some way to have ghc tell me about pointless imports?
01:12 <Squarism> ...stuff that isnt used that is
01:13 <Forkk> so haskell seems to be freeing all my foreign pointers when they're still in scope
01:13 binobi joined
01:13 <Forkk> I don't understand how this is possible
01:13 RasmusWL joined
01:13 <RasmusWL> has the synopsis overview from hoogle been removed?
01:14 cschneid_ joined
01:14 jmcarthur joined
01:14 roconnor joined
01:15 <Forkk> well I found the problem. had the line `fptr <- newForeignPtr code_free cptr` twice :|
01:15 <Forkk> oops
01:16 binobi joined
01:17 AntiSpamMeta joined
01:17 lieven joined
01:19 snowalpaca joined
01:20 FreeBirdLjj joined
01:21 tek0 joined
01:21 path[l] joined
01:21 binobi joined
01:22 orzo joined
01:26 eacameron joined
01:27 ptvirgo joined
01:28 guardianJ left
01:31 mda1 joined
01:34 jedws joined
01:35 aarvar joined
01:36 oisdk joined
01:36 ramzifu joined
01:40 guardianJ joined
01:41 dan_f joined
01:41 Textmode joined
01:41 ajhager joined
01:43 FreeBirdLjj joined
01:46 <jle`> michalrus: are you familiar with how pattern matching works?
01:46 <jle`> michalrus: you can match on numeric literals
01:46 <Forkk> yeah but shouldn't let 1 = 2 in 1 cause a match failure
01:46 <Forkk> since 1 isn't 2
01:47 <pikajude> no
01:47 <pikajude> because 1 matches 1
01:47 <jle`> > let Nothing = Just 10 in "hello"
01:47 <lambdabot> "hello"
01:47 <Forkk> what
01:47 <Forkk> why does that happen
01:47 <jle`> match failures are only checked if you use what is inside
01:47 <jle`> > let Just x = Nothing in "hello"
01:47 <lambdabot> "hello"
01:47 guardianJ joined
01:47 <jle`> > let Just x = Nothing in x
01:47 <lambdabot> *Exception: <interactive>:3:5-20: Irrefutable pattern failed for pattern Just x
01:47 <jle`> ^ Forkk, michalrus
01:47 <Forkk> interesting
01:47 <jle`> pattern matching is lazy
01:48 <jle`> the match is only resolved if any bindings inside are needed
01:48 <jle`> so let Just x = Nothing in "hello" doesn't actually do the pattern matching unless x is needed
01:48 sveit joined
01:48 <jle`> in let 1 = 2 in 3, there are no bindings generated in the pattern match '1 = 2', so nothing really can happen
01:49 <jle`> if '1 = 2' created a binding like 'Just x = Nothing' does, then if you evaluated it, you'd get problems
01:49 <jle`> but no bindings, no way to really cause any problems
01:49 <nshepperd_> let bindings are lazy. Pattern matching in a case is strict
01:50 <jle`> 1 = 2 is a bit of a silly pattern match but there's no reason to explicitly disallow it, since it's consistent with haskell pattern matching/let binding syntax
01:50 <Forkk> > case Just 1 of Nothing -> 0
01:50 <lambdabot> *Exception: <interactive>:(3,1)-(4,22): Non-exhaustive patterns in case
01:50 <jle`> yes, sorry, should have clarified
01:50 lambdafan joined
01:50 robertkennedy joined
01:51 <sveit> is there an "idiomatic" (i have a solution using explicit recursion) way to produce the list [0 (a0 times), 1, 0 (a1 - a0 - 1 times), 1, 0 (a2 - a1 - 1 times),...] given the list [a0, a1, a2, ...] of ascending integers? Preferably something that fuses well
01:52 <jle`> can you give example inputs/outputs?
01:52 <sveit> so for example the list [1,3,4] should produce [0,1,0,1,1]
01:53 <angerman> can someone recommend some th heavy library? I'd like to try some th compilation.
01:53 <angerman> E.g. some library that uses a lot of th.
01:53 <hpc> uses, or would just providing definitions work?
01:54 <sveit> what i really want to do is, for some N, take N (repeat 0) and for each index in some input list (i.e. [1,3,4]) replace 0 with 1
01:55 guardianJ joined
01:55 <sveit> this seems like a "fusable" operation, so i'd like something that is likely to fuse if possible (i.e. efficient)
01:55 pleax joined
01:56 charly_ joined
01:58 <kadoban> sveit: What are you using it for after that? That seems like a fairly questionable operation on its own, adding a lot of ... stuff around not much data
02:01 <angerman> hpc: uses, or e.g. makes ghc have to compile th.
02:01 <sveit> kadoban: this is actually a minimal example. in my particular application the objects are more complicated than integers and the list gets folded at the end. i can give a less trivial example if that would somehow help. the conceptual idea is to, without explicit recursion, emulate a sequence of while loops
02:01 guardianJ joined
02:02 markasoftware joined
02:04 guardianJ joined
02:05 zcourts joined
02:05 halogenandtoast joined
02:05 eacameron joined
02:06 ajhager joined
02:07 ericsagnes joined
02:08 xall joined
02:08 <kadoban> sveit: Hmm, I'm not sure I'm following you. I just know that when I notice myself doing that type of thing, I'm often better off just ... not doing that transformation unless I'm really forced to by subsequent needs.
02:08 ognajd joined
02:09 cyphase joined
02:09 zcourts_ joined
02:10 <kadoban> Possibly not a helpful comment, since it sounds like you have a solid goal in mind that I don't quite understand.
02:10 michael3 joined
02:10 mhagemeister joined
02:11 bjz joined
02:12 conal joined
02:12 <sveit> kadoban: here is a less minimal example. suppose i want to create a path on a square lattice by moving up and right (so a list of data Steps = Up | Right) to process later. This is a list like [Up, Right, Up, Up, ...]. A compact way to represent such a path is by a list of ascending integers, where each integer tells you where to take a "Right" step. So [1,3,4] represents the path [Up, Right, Up, Right, Right, Up, ...]. I want to run a
02:12 <sveit> fold over the latter list. The question is how to efficiently convert [1,3,4] to the list of steps.
02:15 <Squarism> it seems my hunit test suite cannot access parts of my lib that isnt in "exposed-modules" in my cabal file. Is that how its supposed to work?
02:15 <Squarism> (i hoped test suite had special priviliges)
02:15 steeze joined
02:16 nomotif joined
02:16 infinity0_ joined
02:16 infinity0_ joined
02:18 louispan joined
02:18 Costar joined
02:19 infinity0_ joined
02:19 infinity0_ joined
02:19 ajhager joined
02:19 seagreen joined
02:20 mjs2600 joined
02:21 infinity0 joined
02:24 eacameron joined
02:24 infinity0 joined
02:25 Guest79896 joined
02:25 AfC joined
02:25 mhagemeister joined
02:25 FreeBirdLjj joined
02:26 <kadoban> sveit: concat . concatMap ((\x -> [x, [Right]]) . (flip replicate Up) . max 0 . pred) $ zipWith (-) xs (0:xs) -- or explicitly recursive is the best I can come up with, but neither looks particularly great
02:27 infinity0 joined
02:28 eacameron joined
02:28 systadmin joined
02:29 Jacoby6000__ joined
02:30 fkurkowski joined
02:30 <sveit> hmm. thanks. do you think i should just prefer explicit recursion to a stack of functions like that?
02:30 infinity0 joined
02:31 vadimich joined
02:32 <sveit> i mean specifically for efficiency. it looks like lots of concatenations on lists will be happening
02:32 vicfred joined
02:32 vadimich joined
02:33 wtetzner joined
02:35 <kadoban> Not sure, the explicit recursive one is probably a bit faster when it matters. But if the lists are going to be long enough for it to matter, maybe there's a better way to do this than explicitly building the list?
02:35 alx741_ joined
02:37 ContessaTP joined
02:37 AntiSpamMeta joined
02:39 orzo joined
02:44 orzo joined
02:47 michbad joined
02:47 sssilver joined
02:50 featherlessbiped joined
02:50 mikecaruso1 joined
02:51 noan_ joined
02:51 <sveit> generating the list explicitly isn't so bad. i'm actually a bit surprised there isn't a lens that lets me get/set multiple list elements at once
02:51 sellout- joined
02:52 <jchia> There are different schemes to compress data and they can be combined in different ways. e.g. I may apply difference encoding, followed by RLE, followed by huffman encoding. Given an input stream with known fixed-record structure, I may also choose split out different parts of the records and compress them differently. Is there a library the provides compression and decompression algorithms as combinators that I can easily connect together?
02:52 ramzifu joined
02:52 <kadoban> sveit: It's quite possible that there is and I just don't know it.
02:53 <peddie> jchia: I don't know of one, but if you find one, please tell me -- I've wanted this too
02:53 <jchia> peddie: If I have time, I'll try to make one, but I think it won't be anytime soon.
02:53 <peddie> jchia: that's what I concluded too :) good luck
02:54 hexagoxel joined
02:55 cschneid_ joined
02:56 cschneid_ joined
02:56 <jchia> peddie: I wonder if binary can be used for this. You can wrap a ByteStream in a newtype that determines the kind of encoding you apply when you compress. Splitting up the input stream is another matter, though.
02:56 ajhager joined
02:56 <jchia> peddie: I man ByteString
02:56 <jchia> mean
02:56 pleax joined
02:56 raycoll joined
02:57 <peddie> jchia: I don't see any reason that wouldn't work
02:57 FreeBirdLjj joined
02:57 lak joined
02:58 coltfred joined
02:58 systadmi1 joined
02:59 mrkgnao joined
03:00 TxmszLou joined
03:00 hucksy joined
03:01 al-damiri joined
03:02 tumdedum joined
03:03 lak joined
03:04 Fairy joined
03:04 cdg joined
03:04 _sras_ joined
03:04 alx741 joined
03:04 takle joined
03:05 sssilver joined
03:06 exferenceBot joined
03:06 <_sras_> Weird "stack build" behavior. says "File name does not match module name. Saw B. Expected A.B", and when I change it to A.B it says "Saw A.B. Expected A". Why does this happen?
03:07 <Koterpillar> what is the file name, relative to the cabal file?
03:07 verement joined
03:07 <_sras_> the file is in a folder "src/Config/AbcConfig.hs"
03:08 <_sras_> Koterpillar: Sorry. The filename is "src/Config/AbcConfig.hs"
03:08 Rodya_ joined
03:08 <_sras_> Koterpillar: I have added the "src/Config" to the list of source directories.
03:09 <pikajude> do you import it from other places
03:09 <geekosaur> that may be the problem; if you call the module Config.AbcConfig then you want the source directory to be src not src/Config
03:09 tumdedum joined
03:10 <_sras_> pikajude: Yes. From a module in src folder.
03:10 <pikajude> if you have src and a subfolder of src both listed as source directories it will confuse GHC
03:10 <_sras_> pikajude: Ok. So how should it be. Just the "src" folder?
03:10 <pikajude> yeah
03:10 mhagemeister joined
03:10 lspitzner joined
03:10 hexagoxel joined
03:11 <pikajude> what happens is that both Config.Foo and Foo become valid names for the module but which one the compiler actually expects depends on how it's imported from other modules
03:11 <pikajude> so best just to use src
03:11 Rainb joined
03:11 kendricktan joined
03:12 Koterpillar joined
03:13 cyphase_ joined
03:13 <_sras_> pikajude: But now it says "failed to load interface for module"...
03:13 <pikajude> whenever i see those errors i usually run a clean and try again
03:15 indi_ joined
03:15 indi_ joined
03:16 louispan joined
03:17 uglyfigurine joined
03:18 MrWoohoo joined
03:19 <Squarism> can one see haddock docs in ghci?
03:20 <monochrom> No.
03:20 unmanbearpig joined
03:21 <pikajude> ghci would need to be a fully fledged browser then
03:21 <pikajude> or at least a pdf viewer
03:21 <peddie> it would be cool to be able to get docstrings of some kind in ghci
03:22 <pikajude> well they'd have to be added to the object files
03:22 <peddie> yes
03:24 raycoll joined
03:25 <_sras_> pikajude: It worked. Thanks.
03:27 soLucien joined
03:28 lambdafan joined
03:30 mac10688 joined
03:32 peterbecich joined
03:32 JoshS joined
03:33 lak joined
03:35 fabianhu_ joined
03:35 howdoi joined
03:36 mvr_ joined
03:36 ramzifu joined
03:38 ffilozov joined
03:40 <Costar> what mean "type Example a" inside a class using TypeFamilies?
03:41 systadmin joined
03:44 voidhorse joined
03:47 ajhager joined
03:47 eklavya joined
03:50 FreeBirdLjj joined
03:50 haennar joined
03:56 hamishmack joined
03:56 Goplat joined
03:57 pleax joined
04:00 xall joined
04:00 refold joined
04:01 <c_wraith> Costar, it defines a type family named example that's associated with the class.
04:01 <c_wraith> Costar, also called an associated type
04:01 <c_wraith> Costar, if you're familiar with rust, they took that feature wholesale
04:01 fracting joined
04:02 <Costar> c_wraith: it is like a "function of types"?
04:02 <c_wraith> Costar, type families in general are fun cti
04:02 <c_wraith> .. functions on types
04:02 <Costar> yeah
04:02 <c_wraith> associated types
04:02 <c_wraith> ... I'm having operator issues. :)
04:03 ludat joined
04:03 rkazak joined
04:03 <c_wraith> associated types are just defined as part of a class and it's instances, but are exactly as powerful
04:03 <Costar> c_wraith: they are used just to enhace type safety?
04:04 eacameron joined
04:04 <c_wraith> Costar, no. they're used to expand the capability of of type classes.
04:04 exferenceBot joined
04:04 takle joined
04:05 <c_wraith> multiparameter type classes with functional dependencies give you similar power, but feel much more like prolog than writing functions.
04:05 <jle`> Costar: when you write a typeclass instance, you get to implement its methods
04:06 <Costar> c_wraith: I havent dig this part of Haskell deeply
04:06 <jle`> Costar: if the typeclass has an associated type, you also give the associated type
04:06 <jle`> it's just another "part" of the typeclass
04:07 lspitzner joined
04:07 Shatnerz joined
04:07 <jle`> typeclasses let you define functions/values/types for each instance
04:07 <mniip> prolog is much more powerful than mptcs anyway
04:07 <c_wraith> Costar, https://www.microsoft.com/en-us/research/wp-content/uploads/2016/07/typefun.pdf gives a bunch of good examples
04:07 snowalpaca joined
04:07 <Costar> c_wraith jle` thank you guys
04:07 <c_wraith> Costar, and it's very easy to read, even though it's an academic paper. :)
04:07 mjo joined
04:07 mjo joined
04:08 dan_f_ joined
04:09 hexagoxel joined
04:09 <Costar> c_wraith: I was reading about HLearn, and the guy defined a "type Ring a" inside a class
04:09 <Costar> c_wraith: now its clear
04:10 <Costar> jle`: i know the basics of typeclasses, but i fail in typefamilies.
04:10 rekahsoft joined
04:10 theelous3 joined
04:10 connrs joined
04:10 <jle`> you don't really have to know about type families in general to use associated types, i think
04:11 <jle`> class Foo a where
04:11 <jle`> type Bar a
04:11 <jle`> bar :: a -> Int
04:11 <jle`> so if you write an instance of 'Foo', you provide an implementation of 'bar' (the function) and also of 'Bar' (the associated type
04:11 <jle`> instance Foo String where
04:11 <jle`> type Bar String = Bool
04:11 <jle`> bar = id
04:11 <jle`> ta dah
04:11 <jle`> that's it :)
04:12 <jle`> s/id/length
04:12 <Costar> jle`: nice example, thanks.
04:13 danharaj joined
04:15 cschneid_ joined
04:16 takle joined
04:18 mounty joined
04:18 cyphase joined
04:23 takle joined
04:25 otto_s joined
04:25 sword865 joined
04:25 flebron joined
04:34 tommd joined
04:34 lak joined
04:36 mizu_no_oto joined
04:36 ramzifu joined
04:38 takle joined
04:38 xtreak joined
04:39 chenshen joined
04:40 zcourts joined
04:40 bjz joined
04:41 <jle`> no problem!
04:43 juri_ joined
04:45 Uakh joined
04:46 shinX joined
04:46 monadicDuck joined
04:46 ajhager joined
04:47 MarcelineVQ joined
04:47 Micamo joined
04:47 Uakh joined
04:50 RasmusWL left
04:54 pleax joined
04:54 serendependy joined
04:56 lithie joined
04:58 systemfault joined
04:59 msko joined
04:59 hexagoxel joined
05:00 falafel joined
05:01 <threshold> num <- newEmptyMVar ; forkIO (putMVar num 3) -- No instance for (Num GHC.Prim.Any) arising from the literal ‘3’ In the second argument of ‘putMVar’, namely ‘3’
05:02 <c_wraith> is that from an old version of ghci?
05:03 <threshold> 8.0.1
05:03 <c_wraith> ah, but it is ghci?
05:03 <threshold> c_wraith: yeah
05:04 <c_wraith> ghci doesn't get global inference.
05:04 <mniip> I could see where that's coming from
05:04 <mniip> ah right
05:04 <mniip> "num <- newEmptyMVar"
05:04 <c_wraith> yep.
05:04 <mniip> by that poiny num :: MVar Any
05:04 <mniip> point*
05:05 <threshold> I started guessing ways around this, but I wish that didn't occur. forkIO (putMVar num 3 :: Int)
05:05 <threshold> That didn't work
05:05 <glguy> does it help to add a do to the beginning?
05:05 <mniip> threshold, no like, if the two are different statements, the 'num' is bound with a wrong type already
05:06 <c_wraith> threshold, newEmptyMVar :: IO (MVar Int)
05:06 <mniip> if ghci could go back and reinfer 'num' as MVar Integer when you typed the second line...
05:06 <mniip> well nothing would make sense then
05:07 <c_wraith> threshold, the problem is that ghci wasn't implemented to read from the future to infer types.
05:07 <threshold> c_wraith: that did the trick
05:07 <mniip> although
05:07 <mniip> it could go with 'forall a. MVar a'
05:07 <mniip> but that's unsafeCoerce right there
05:08 <c_wraith> if ghci could just tell the future when type checking... so much easier.
05:08 <mniip> this issue could be avoided with representing mvars as actual sources/sinks
05:08 <mniip> but yeah, future reading
05:08 <mniip> I hear that's planned for 8.3
05:09 <monochrom> "The future is always brighter"
05:10 <c_wraith> I think glguy's suggestion should work, though.
05:10 <mniip> a monotonic function huh
05:10 <c_wraith> since it makes the two statements a single expression, so they're all type-checked together.
05:11 <monochrom> Then you need your own "return num" so you don't lose it.
05:11 mhagemeister joined
05:11 <c_wraith> that's true.
05:11 <monochrom> In fact the whole "num <- do { num <- ... ... return num }"
05:11 <mniip> monochrom, but wait, it is brighter in whose frame of reference? What if we have a ghci moving relative to another ghci at 0.5c?
05:12 <threshold> let terrible = do num <- newEmptyMVar :: IO (MVar Int) ; forkIO (putMVar num 3) ; forkIO (putMVar num 4) ; v <- takeMVar num ; return v in iterate (print . terrible) 50000
05:12 Xanather joined
05:12 <threshold> > let terrible = do num <- newEmptyMVar :: IO (MVar Int) ; forkIO (putMVar num 3) ; forkIO (putMVar num 4) ; v <- takeMVar num ; return v in iterate (print . terrible) 50000
05:12 <lambdabot> error:
05:12 <lambdabot> Not in scope: type constructor or class ‘MVar’
05:12 <mniip> you can't do that
05:13 <threshold> mniip: The compiler agrees
05:13 <mniip> iterate is not the function you're looking for
05:13 <mniip> :t replicateM_
05:13 <lambdabot> Applicative m => Int -> m a -> m ()
05:13 <mniip> that's what you're looking fo
05:13 <mniip> also <$> not .
05:14 <monochrom> No, . won't do either
05:14 <mniip> that's what I said!
05:14 raycoll joined
05:14 <monochrom> Ah. No, <$> won't do either.
05:15 <mniip> terrible :: IO Int
05:15 <mniip> lgtm?
05:15 louispan joined
05:15 <monochrom> @type print
05:15 <lambdabot> Show a => a -> IO ()
05:15 <monochrom> @type print . (undefined :: IO Int)
05:15 <lambdabot> error:
05:15 <lambdabot> • Couldn't match expected type ‘a -> ()’ with actual type ‘IO Int’
05:15 <lambdabot> • In the second argument of ‘(.)’, namely ‘(undefined :: IO Int)’
05:15 <monochrom> Sigh, I keep saying the wrong guy.
05:15 <monochrom> @type print <$> (undefined :: IO Int)
05:16 <lambdabot> IO (IO ())
05:16 <monochrom> Is that what you want? In fact...
05:16 <monochrom> @type replicateM_ 10 (print <$> (undefined :: IO Int))
05:16 <lambdabot> IO ()
05:17 <monochrom> OK, I guess that isn't informative.
05:17 <threshold> getNum = do num <- newEmptyMVar :: IO (MVar Int) ; forkIO (putMVar num 3) ; forkIO (putMVar num 4) ; v <- takeMVar num ; return v ; main = do nums <- replicateM 50000 getNum ; mapM_ print nums
05:17 <monochrom> This is the job of =<<
05:19 osa1 joined
05:19 osa1 joined
05:19 isenmann joined
05:19 <threshold> Is there a common function similar to print which prints without attaching a new line?
05:19 <threshold> e.g. putStr
05:19 <monochrom> No, but you can combine "show" and "putStr"
05:20 <threshold> Thanks monochrom
05:20 <threshold> That worked
05:21 sveit left
05:21 FreeBirdLjj joined
05:22 eklavya joined
05:23 takle joined
05:24 <mniip> oh
05:24 <mniip> oops
05:24 <mniip> right
05:24 <mniip> >>=
05:24 <mniip> Ls
05:24 <mniip> :s *
05:24 FreeBird_ joined
05:24 petervaro joined
05:26 gcross joined
05:28 <jle`> hi
05:28 <jle`> will Profunctor ever be in base?
05:29 <jle`> i'm reading https://www.reddit.com/r/haskell/comments/3kbj9r/edward_kmett_the_unreasonable_effectiveness_of/cuwucle/ but i don't really see the real issue
05:31 <mniip> jle`, well you can see why being able to rewrite 'fmap coerce' into 'coerce' is a good idea?
05:31 <jle`> i do
05:32 alex_lu joined
05:32 <mniip> and how that is fairly tricky to do without adding unsafety
05:33 <jle`> how does profunctor cause complications in that?
05:33 <mniip> I think ed deems profunctor useless without #./.#
05:33 <mniip> and he wants a more uniform interface?
05:34 <c_wraith> not useless
05:34 <threshold> Is this the package I need to install in order to use LVars?
05:34 <c_wraith> just a massive performance regression
05:34 <threshold> Ivar
05:35 <mniip> well
05:35 <mniip> sure
05:35 <mniip> #. can be implemented in terms of rmap
05:35 <mniip> but that's "useless"
05:35 cschneid_ joined
05:35 mrkgnao joined
05:36 lak joined
05:36 ramzifu joined
05:36 <jle`> why not have #./.# in base?
05:36 <jle`> i mean, in a hypthetical base Profunctor
05:37 <mniip> 1488432829 [08:33:49] <mniip> and he wants a more uniform interface?
05:37 <c_wraith> because they're not good enough for general use
05:37 <c_wraith> They're good enough for lens, but not things that use profunctors in other ways
05:37 <mniip> basiscally you'd want a similar function in Functor
05:37 <mniip> and Contravariant
05:37 <mniip> but
05:37 <mniip> more "general"
05:38 <jle`> just having them there doesn't detract from their utility, does it?
05:38 <MarcelineVQ> threshold: is what the package?
05:38 <jle`> it might be ugly
05:39 TxmszLou joined
05:39 <mniip> yeah but it means more changes later
05:39 <MarcelineVQ> threshold: IVar's are from monad-par afaik http://hackage.haskell.org/package/monad-par http://chimera.labs.oreilly.com/books/1230000000929/ch04.html
05:39 <mniip> you'd want something like this resolved before adding profunctor
05:39 tommd joined
05:40 systadmin joined
05:44 vlatkoB joined
05:46 zcourts joined
05:47 howdoi joined
05:47 brynser joined
05:48 Einwq joined
05:49 juhp joined
05:52 ramzifu joined
05:52 Unhammer joined
05:54 sgfltx joined
05:54 pleax joined
05:55 mhagemeister joined
05:58 eacameron joined
05:59 slack1256 joined
05:59 buttons840 joined
06:01 m4v1 joined
06:02 <hrumph> what is the simplest possible monad
06:02 <barrucadu> Identity?
06:03 <hrumph> there's no null monad or anything like that?
06:03 dec0n joined
06:03 pantsman_ joined
06:04 <hrumph> https://gist.github.com/mikehadlow/795905
06:04 <hrumph> according to this web page the identity monad is the simplest
06:04 <hrumph> is that true?
06:05 <barrucadu> Well, it depends what you mean by "simple". Certainly I can't think of a monad I'd call simpler than Identity.
06:05 vicfred joined
06:06 <barrucadu> There's also Proxy, that's pretty simple
06:07 <slack1256> I have problem understanding the traversable laws. If they are mean to be distributive functors over applicatives, how can I guarrante than a value won't be execute (applicative effects) twice?
06:07 <slack1256> Or should I stay with the intuition "distribution over applicative"?
06:08 FreeBirdLjj joined
06:08 dmiles joined
06:08 logicmoo joined
06:09 systemfault joined
06:09 <mniip> hrumph, what is the simplest monoid?
06:09 <hrumph> mniip don't know yet
06:09 <hrumph> wonderinf if tehre was something even simpler than identity like a "null monad"
06:09 <hrumph> not sure
06:10 <mniip> well, if you answer "the one with just one element", then by that token, Proxy is what you're looking for
06:10 eacameron joined
06:11 <mniip> because that's the "null" object in the endofunctor category
06:12 <hrumph> mniip do you have a url for that?
06:13 mhagemeister joined
06:13 <mniip> uhh
06:13 <mniip> afraid not
06:14 eacameron joined
06:14 <mniip> I could link the Monad Proxy definition
06:14 <mniip> https://hackage.haskell.org/package/base-4.9.1.0/docs/src/Data.Proxy.html#line-98
06:14 takle joined
06:15 <hrumph> ok
06:16 <hrumph> it's basically exactly what i thought
06:16 <hrumph> so that's the simplest monad
06:16 jsoo joined
06:16 hexagoxel joined
06:17 danvet joined
06:18 <Squarism> Im curious if you people working with haskell, studying it or play with it for fun?
06:20 ramzifu joined
06:21 <atian> Squarism i smoke it
06:21 insitu joined
06:23 ner0x652 joined
06:23 <Squarism> fmap'ing the Bong-monad
06:23 <monochrom> I use Haskell and study it and play with it.
06:23 <monochrom> I don't think there is a need to choose one.
06:23 <atian> haskell strain
06:24 takle joined
06:24 augur joined
06:24 <atian> very good if you ask me
06:24 <Squarism> monochrom, ok
06:24 <Squarism> im mostly curious if people use it for work I guess
06:25 <Squarism> The type you get paid for
06:26 <atian> Squarism have you considered doing stand up comedy
06:26 <monochrom> Haskell jobs are fewer. But people can still use it personally.
06:26 YongJoon_ joined
06:27 dan_f joined
06:28 <monochrom> My job is teaching. And it is not teaching Haskell. But I used Haskell to write utilities and check answers. Haskell did help me earn my money efficiently.
06:29 connrs joined
06:29 <Squarism> Okey. Glad you found a way.
06:30 infinity0 joined
06:32 igniting joined
06:33 Argue joined
06:35 ddere joined
06:37 louispan joined
06:38 Swizec joined
06:39 shesek joined
06:40 Rainb joined
06:44 tom[m] joined
06:47 peterbecich joined
06:47 effectfully_ joined
06:47 <effectfully_> Hi. `stack build` says "Warning: <blah> needs to be a dynamically linked executable; please pass --enable-executable-dynamic to 'cabal install'.". What should I do?
06:48 zcourts joined
06:48 markh joined
06:51 exbio joined
06:52 exbio left
06:52 exbio joined
06:52 tom[m] left
06:53 nighty joined
06:54 peterbec` joined
06:55 pleax joined
06:57 thunderrd joined
06:59 browndawg joined
07:00 xtreak joined
07:01 hazmat_ joined
07:01 hazmat__ joined
07:01 hazmat_ joined
07:02 insitu joined
07:02 sobaken joined
07:02 unK_ joined
07:04 edsko joined
07:05 raichoo joined
07:06 kritzcreek_ joined
07:06 certainty joined
07:06 takle joined
07:08 eacameron joined
07:11 quchen joined
07:13 mhagemeister joined
07:13 osa1 joined
07:13 osa1 joined
07:15 jhrcek joined
07:19 guiben joined
07:19 pleax joined
07:21 sjakobi joined
07:21 zeroed joined
07:21 zeroed joined
07:21 takle joined
07:25 <msko> account list
07:25 KarboniteKream joined
07:25 xtreak joined
07:25 fizruk joined
07:26 connrs joined
07:29 kthnnlg joined
07:34 razi1 joined
07:35 alfredo joined
07:36 lak joined
07:37 harfangk joined
07:37 takle joined
07:39 refold joined
07:40 humboldt joined
07:40 BartAdv joined
07:41 Argue_ joined
07:42 treehaqr joined
07:43 efelo_ joined
07:43 shafox joined
07:44 thecrooked joined
07:45 HugoDaniel joined
07:45 E_ joined
07:45 raichoo joined
07:46 takle joined
07:46 Argue__ joined
07:47 <effectfully_> Anybody?..
07:48 <markh> ?
07:48 <ezyang> try http://stackoverflow.com/questions/38863005/how-do-i-get-stack-to-use-dynamic-linking maybe
07:48 zcourts joined
07:49 free_beard joined
07:49 <effectfully_> markh: `stack build` says "Warning: <blah> needs to be a dynamically linked executable; please pass --enable-executable-dynamic to 'cabal install'.". What should I do?
07:49 <effectfully_> ezyang: I tried, but it doesn't seem to work
07:49 <effectfully_> I'm getting the same warning
07:50 <markh> have you tried cabal install --enable-executable-dynamic
07:50 <effectfully_> markh: I use Stack and this is Stack that tells me to do something with Cabal, which I have no idea what means
07:50 <ezyang> don't do that, he's using stack
07:51 <ezyang> effectfully_: Which ghc-options did you add it to
07:51 albertid joined
07:51 <effectfully_> ghc-options: -W <some_other_options> -dynamic
07:52 efelo__ joined
07:52 <ezyang> yes but which cabal file did ou add it to
07:52 <ezyang> did you add it to the executable
07:52 <effectfully_> yes
07:53 <ezyang> does the executable work or not
07:53 <effectfully_> it worked when I manually copied the library it needs
07:54 <ezyang> see, with cabal-install, I know --enable-executable-dynamic will do the right thing
07:54 <effectfully_> but the library is generated dynamically
07:54 <ezyang> maybe you are using https://github.com/commercialhaskell/stack/issues/1691
07:54 insitu joined
07:54 <ezyang> *hitting
07:54 JanBessai joined
07:54 <ezyang> Are you saying that stack is not setting an rpath
07:55 Ulrar joined
07:55 Elsi joined
07:55 <effectfully_> yes, I know that cabal is able to do what I want, but I have other problems with cabal
07:56 calincru joined
07:56 <ezyang> effectfully_: Have you tried using new-build?
07:56 <ezyang> What do you mean by copy the library?
07:56 <effectfully_> "is not setting an rpath" -- sorry, I don't understand
07:57 <effectfully_> no, I haven't tried, thanks for linking the issue
07:57 <ezyang> "What do you mean by copy the library?"
07:57 <effectfully_> there are several packages, one of them generates a library, the other requires that library
07:57 <effectfully_> I see the error, manually copy the generated library to be on $PATH
07:57 greeny__ joined
07:58 <effectfully_> and things work
07:58 mda1 joined
07:58 <ezyang> ...PATH or LD_LIBRARY_PATH
07:58 Yuras joined
07:58 <ezyang> are you on Windows?
07:58 <effectfully_> no, Ubuntu
07:58 <ezyang> and what is "the error"
07:59 <effectfully_> just $PATH, I think
07:59 efelo__ joined
07:59 JanBessai joined
07:59 connrs joined
07:59 <effectfully_> I meant the warning, sorry, the one that I posted previously, then comes an error, but it just says that a library is not found essentially
08:00 Jex joined
08:00 <effectfully_> *the library
08:01 <ezyang> the specific error message is kind of important; but anyway, I think I know what's going on
08:01 afarmer joined
08:01 lithie joined
08:02 <effectfully_> ezyang: the error is "[1 of 1] Compiling Main ( src/Main.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/qtah-examples/qtah-examples-tmp/Main.o ) /home/roman/code/qtah/qtah-examples/src/Main.hs:33:1: error: Failed to load interface for ‘Graphics.UI.Qtah.Widgets.QGraphicsView’"
08:02 <effectfully_> but I don't think it's important
08:02 markh left
08:02 <ezyang> that looks important...
08:02 <effectfully_> sorry then
08:02 <Guest16373> OverloadedLabels example code not work: http://dev.stephendiehl.com/hask/#overloadedlabels
08:02 <ezyang> OK, now I am confused
08:03 <ezyang> "Failed to load interface" error has nothing to do with dynamic library loading
08:03 raichoo joined
08:03 <Theophane> hey raichoo o/
08:03 xtreak joined
08:03 <effectfully_> that interface is what I added to the library against which the executable meant to be built
08:04 <ezyang> did you forget to add the module to other-modules/exposed-modules?
08:04 peterbec` joined
08:04 <effectfully_> ouch
08:04 <effectfully_> I might
08:04 <effectfully_> that would be really stupid
08:04 Argue_ joined
08:05 <ezyang> erm, it's not a stupid mistake
08:05 <ezyang> just dumb tools :) (Cabal library problem)
08:05 _sg joined
08:05 <ezyang> we even have a bug for it...
08:07 Iskarlar joined
08:08 srbaker_ joined
08:08 <effectfully_> ezyang: OK, I forgot to add the module to .cabal, thank you very much, I'll fix that, but why does stack still gives me a warning about --enable-executable-dynamic?
08:08 connrs joined
08:09 <ezyang> well, probably because putting -dynamic in ghc-options is a hack
08:09 <ezyang> and the build system really ought to be informed about this sort of thing
08:09 solrize joined
08:09 solrize joined
08:09 <effectfully_> I see
08:09 <ezyang> like, what if it decided not to actually build the dynamic libraries
08:10 alibabzo joined
08:10 Bish joined
08:10 jgertm joined
08:11 mohsen_ joined
08:12 <raichoo> Theophane: hey o/
08:13 connrs joined
08:13 baldrick1 joined
08:14 <effectfully_> yeah, I added all forgotten entries to .cabal and everything builds alright now. Thanks, ezyang
08:15 emin joined
08:16 mattyw joined
08:16 albertid joined
08:17 <ezyang> great!
08:18 <ezyang> and may this be a lesson to copy paste error messages :)
08:18 <effectfully_> lesson learned
08:18 Maxou joined
08:19 Beetny joined
08:20 edvorg joined
08:21 mohsen_ joined
08:21 <ezyang> I guess the original error message is coming from a Setup script or something
08:21 <ezyang> cuz that error string doesn't grep for anything in Cabal codebase
08:21 systadmin joined
08:23 fendoer joined
08:25 emin joined
08:26 petervaro joined
08:26 ramzifu joined
08:26 Mortomes|Work joined
08:26 baldrick1 joined
08:27 eklavya joined
08:28 bruschkov joined
08:29 rgc joined
08:31 zero_byte joined
08:31 takle joined
08:32 unmanbearpig joined
08:32 Maxou joined
08:33 certainty joined
08:34 Maxou_ joined
08:38 mbrane joined
08:38 lak joined
08:38 Argue__ joined
08:40 Sampuka joined
08:40 treehaqr joined
08:42 tlaxkit joined
08:44 connrs joined
08:45 thc202 joined
08:46 Argue_ joined
08:47 augur joined
08:49 zcourts joined
08:52 AfC joined
08:52 pleax joined
08:52 jutaro joined
08:56 pantsman_ joined
08:56 ramzifu joined
08:57 insitu joined
09:01 inad922 joined
09:08 gregman_ joined
09:09 louispan joined
09:09 ub joined
09:10 ericsagnes joined
09:12 marr joined
09:12 mdarse joined
09:13 xtreak joined
09:13 bweston92_ joined
09:14 bweston92 joined
09:14 takle joined
09:14 cpup joined
09:17 t7 joined
09:18 ragepandemic joined
09:20 zero_byte joined
09:21 kthnnlg joined
09:24 tomphp joined
09:24 hexagoxel joined
09:26 michael4 joined
09:29 tabaqui1 joined
09:30 Nerterologist joined
09:33 unmanbearpig joined
09:35 michael3 joined
09:37 haennar joined
09:38 zero_byte joined
09:40 danza joined
09:40 path[l] joined
09:40 fendoer joined
09:41 nille joined
09:41 nille joined
09:41 mmn80 joined
09:43 plutoniix joined
09:44 mrijkeboer joined
09:45 mbuf joined
09:46 howdie joined
09:47 <howdie> Hey everyone! I have a question: how do I declare a variable in brainfuck?
09:47 bjz joined
09:47 jgertm joined
09:47 Maxou joined
09:47 <howdie> I'm too lazy to read the docs, y'know
09:47 <lassulus> seems like the wrong channel to ask imho
09:47 <howdie> haskell and brainfuck are both essentially low-level languages, so...
09:48 <howdie> lassulus: you think?
09:48 <howdie> lassulus: would the python channel work?
09:48 Maxou joined
09:48 anton___ joined
09:48 aarvar left
09:49 rps1 joined
09:49 <lassulus> ¯\_(ツ)_/¯
09:50 zcourts joined
09:51 dcoutts_ joined
09:54 pleax joined
09:54 petermw joined
09:55 takle joined
09:56 rcat joined
10:00 mda1 joined
10:00 mymosh joined
10:02 petermw joined
10:04 hexagoxel joined
10:04 Iskarlar joined
10:06 skeuomorf joined
10:07 ragepandemic left
10:09 kakashiAL joined
10:09 pleax joined
10:11 dtornabene joined
10:12 Miroboru joined
10:14 <sjakobi> Does anyone know what's up with hvr? He hasn't been active on GitHub for several weeks now. Is he on vacation or something?
10:14 treehaqr joined
10:15 <quchen> hvr: What’s up? :-)
10:15 <kakashiAL> I am programming with javascript and for some time I spend time with haskell
10:15 <kakashiAL> I learned a lot of great concepts that makes my code easy to read and reason about
10:15 <kakashiAL> I also learned a lot of concepts like identity functors, I implemented one in javascript, now my primitive manipulation are more readable and fun.
10:15 <kakashiAL> long story short: I spend now time with category theory. I learned some fancy vocabulary and new definitions, but what can I do with it now?
10:15 <kakashiAL> I see no usecase :(
10:16 <quchen> I too found the return on investment for category theory extremely low. :-|
10:16 unmanbearpig joined
10:16 <quchen> And in particular, not helpful for my everyday programming at all.
10:16 peterbec` joined
10:16 <sjakobi> kakashiAL: I foun this talk by ekmett pretty mindblowing: https://www.youtube.com/watch?v=cB8DapKQz-I
10:16 oisdk joined
10:16 <Rembane> Maybe it will help you see patterns where there was just a mess before.
10:17 <sjakobi> He starts off with category theory and ends up with linear time sorting instead of O(n log n)
10:17 <michalrus> > match failures are only checked if you use what is inside
10:17 <lambdabot> <hint>:1:33: error: parse error on input ‘if’
10:17 <michalrus> jle`: ah, that makes a lot of sense! Thank you!
10:17 <michalrus> lambdabot: sorry.
10:18 louispan joined
10:18 <kakashiAL> sjakobi: if it shows a simple category theroy example implemented in the real world with some benefits, I am happy
10:18 <jle`> michalrus: no problem!
10:19 <sjakobi> It's not simple for me, but the benefits appear to be real.
10:20 snowalpaca joined
10:20 <kakashiAL> at the moment category theory makes my code easy to reason about :)
10:20 <kakashiAL> well, its more lambda-calc :)
10:23 oish joined
10:23 sobaken_ joined
10:24 mrkgnao joined
10:25 jaspervdj joined
10:27 merijn joined
10:29 uglyfigurine joined
10:29 rotcev joined
10:30 rando6100 joined
10:30 slomo joined
10:31 shayan_ joined
10:33 xall joined
10:33 Yuras joined
10:33 fragamus joined
10:35 Bish joined
10:39 systadmin joined
10:39 ub joined
10:39 lak joined
10:43 hexagoxel joined
10:44 monadicDuck joined
10:44 shinX joined
10:44 anler joined
10:46 laz joined
10:48 jutaro joined
10:48 marfoldi joined
10:49 Onemorenickname_ joined
10:50 lukaramu joined
10:50 <Onemorenickname_> Hello
10:50 <Onemorenickname_> Newbie question
10:51 <Onemorenickname_> When I write "data Earley t = Array Items t", I get "expecting type for Items". I know that I have to wrap "Items t" with parenthesis, but I was wondering if there was some infix operator allowing me to do that
10:51 <Onemorenickname_> akin to "@@" in ocaml
10:51 zcourts joined
10:52 <Xnuk> What is @@ in OCaml?
10:52 <Xnuk> Could you give me some example?
10:52 Coldblackice joined
10:54 <Onemorenickname_> Xnuk, for instance, if I want to write "pop Some 5", I have to wrap "Some 5" in parenthesis : "pop (Some 5)"
10:54 xtreak joined
10:54 <Onemorenickname_> In ocaml, I can write "pop @@ Some 5"
10:55 pleax joined
10:55 <Xnuk> pop $ Some 5
10:55 silver joined
10:55 <Onemorenickname_> can we do that at the type level ?
10:56 bjz_ joined
10:56 <Xnuk> Onemorenickname_: As far as I know, you can't.
10:56 eacameron joined
10:57 <Onemorenickname_> ok, thanks for the value level syntax though, i did not know it :)
10:57 Gurkenglas joined
10:57 mr_sm1th joined
10:58 mekeor joined
10:58 Ralith_ joined
10:59 mekeor joined
11:00 KarboniteKream joined
11:00 <merijn> Xnuk: Well, you can do it on the type level, just not by default :p
11:00 <merijn> @define type f $ a = f a
11:00 <lambdabot> Defined.
11:00 mhagemeister joined
11:00 <merijn> > Right True :: Either e $ Bool
11:00 <lambdabot> Right True
11:01 HanlonsRazor joined
11:01 jmg8766 joined
11:02 <Xnuk> oh
11:03 monadicDuck joined
11:03 pleax joined
11:03 shinX joined
11:03 <Onemorenickname_> merijn, thanks !
11:03 vfewbuew joined
11:06 Argue__ joined
11:08 xtreak joined
11:08 deank joined
11:11 sternmull joined
11:12 Sampuka joined
11:12 cdg joined
11:14 cschneid_ joined
11:17 FullyFunctional joined
11:18 fizruk joined
11:19 contiver joined
11:20 <t7> what do i call the difference between some value and the-target/my-desired value?
11:22 mkoenig joined
11:22 <Rodenbach> t7: maybe „Computation”?
11:24 <opqdonut> heh
11:24 <opqdonut> or "diff"
11:26 <merijn> delta?
11:27 deshipu joined
11:27 <t7> isnt the delta the difference after update?
11:27 deshipu left
11:27 <t7> no
11:27 <t7> hmm
11:29 certainty joined
11:29 eacameron joined
11:29 IanKelling joined
11:29 caumeslasal joined
11:31 fendoer joined
11:31 mekeor joined
11:31 Iskarlar joined
11:32 sarkin joined
11:33 haennar joined
11:33 <merijn> No, just difference
11:34 <t7> delta it is then
11:34 [hr] joined
11:36 iainhallam joined
11:37 <iainhallam> Where do I report bugs for the Haskell Platform installer?
11:38 unmanbearpig joined
11:40 <liste> iainhallam: https://github.com/haskell/haskell-platform/issues
11:41 lak joined
11:41 <iainhallam> Thanks.
11:41 eacameron joined
11:41 haennar joined
11:44 hiro` joined
11:46 inad922 joined
11:46 eacameron joined
11:46 <hiro`> Hey all, just noticed that in my global config the resolver is set to 3.16. I guess that's kinda old now. Is it worth setting it to something more up to date? Does this need to be done manually or is there way to make stack just pick the most recent one?
11:47 russellw joined
11:47 watersoul joined
11:49 uglyfigurine joined
11:49 <jle`> hiro`: i'd just edit it in ~/.stack/global-project/stack.yaml
11:49 <Theophane> hiro`: have you tried editing ~/.stack/config.yaml ?
11:49 <jle`> i'm not sure if there's a way to make it update automatically, but i'm also not sure if that'd be a good idea
11:49 <jle`> but updaitng it is pretty simple
11:50 <jle`> and stack keeps track of things so that you can re-use the same installed packages across different snapshots/resolvers
11:50 <jle`> so you don't have to re-install everything every time you update your resolver
11:50 <jle`> (unless the resolvers use a different version of ghc of course)
11:51 sag3 joined
11:51 Maxou joined
11:52 zcourts joined
11:53 oleks joined
11:53 eacameron joined
11:54 sag3 left
11:55 Miroboru joined
11:55 stoopkid joined
11:56 <hiro`> I haven't edited yet, just wondered if it was worth doing / not doing. Updating to 8.3 now ...
11:56 <iainhallam> So the platform installer can't work with a path other than /usr/local/ghc..., but I would like to install to /opt/haskell.
11:56 <iainhallam> Anyone know a way to get it into the right place, or am I going to be compiling from scratch?
11:57 mohsen_ joined
11:57 <russellw> When installing Haskell on Windows based on the instructions here https://www.haskell.org/platform/ step three, it says paste three lines into Cabal config. The default config file already contains lines assigning at least some of those variables to different values. Is that still intentional? Should I paste the lines from step three at the end of the file or what?
11:58 <hiro`> Are there any other steps that need to be followed when updating the global config?
11:58 blzr joined
11:59 OnkelTem joined
11:59 <hiro`> Eg, stack setup, init, etc?
11:59 danthemyth joined
12:00 jchia_1 joined
12:00 refold joined
12:01 Maxou joined
12:01 cfricke joined
12:02 Snircle joined
12:02 black0range joined
12:03 jchia_1 joined
12:04 jchia_1 joined
12:05 danthemyth joined
12:05 HugoDaniel joined
12:06 black0range left
12:07 <Onemorenickname_> i'm a newbie
12:07 <Onemorenickname_> please dont kill me
12:07 <Onemorenickname_> but
12:08 <brynser> hiro`: I think you'd need to run stack setup to download and install the appropriate GHC version
12:08 <Onemorenickname_> is there a way to tell "Data.Set" : "I don't really mind the Ord of my keys, so just use the pointer address" ?
12:08 Argue joined
12:09 <Tuplanolla> What address is this, Onemorenickname_?
12:09 <Onemorenickname_> Tuplanolla, I come from C
12:10 <Tuplanolla> You know the garbage collector moves things around, so even if you were to find the address of an object, it could suddenly stop working.
12:10 <Onemorenickname_> Tuplanolla, I was just thinking about that
12:10 Maxou joined
12:10 <Onemorenickname_> I was typing "haskell garbage collection" in google :D
12:10 <Tuplanolla> We have mechanisms to pin objects, but those are only used with ffi.
12:11 <Onemorenickname_> in haskell, how would you compare (x = 1:x) and (y = 1:y) ?
12:11 bjz joined
12:11 <brynser> The unordered-containers package has HashSet which doesn't use Ord
12:11 <Onemorenickname_> (they were not made from the same expressions, just two results of functions calls happen to have these value)
12:12 <Tuplanolla> The comparison of infinite lists is semidecidable, so ideally you wouldn't compare them at all.
12:12 <Onemorenickname_> "Deprecated: HashSet is deprecated. Please use Set instead.
12:12 <Onemorenickname_> The HashSet is a type synonym for Set for backward compatibility. It is deprecated and will be removed in furture releases."
12:12 <brynser> Oh, I didn't know that, sorry
12:12 <Onemorenickname_> Tuplanolla, I don't think comparing recursive lists (different from infinite lists) is only semidecidable
12:13 <Onemorenickname_> you can do some graph thingy if you can compare reference
12:13 <Onemorenickname_> oh
12:13 <Onemorenickname_> is there physical equality in haskell ?
12:13 <Onemorenickname_> still, this won't give me an ord, even if it exists
12:13 <brynser> Onemorenickname_: I think that deprecation warning is for a different HashSet
12:13 <brynser> I don't see it here https://hackage.haskell.org/package/unordered-containers-0.2.7.2/docs/Data-HashSet.html
12:13 jeltsch joined
12:14 fedomedobedogedo joined
12:15 halogenandtoast joined
12:15 <Onemorenickname_> brynser, i just typed HashSet haskell in google and got https://hackage.haskell.org/package/hashmap-1.3.2/docs/Data-HashSet.html
12:15 <Onemorenickname_> so i will pick your package then :)
12:15 saylu joined
12:15 <brynser> :D
12:15 <Onemorenickname_> ddo you know if it can hash recursive lists ?
12:15 contiver joined
12:16 anler joined
12:16 takle joined
12:17 <Tuplanolla> Hashes or not, what you want is impossible.
12:18 <Onemorenickname_> Tuplanolla, I can not have a structure holding recursive lists without duplicates ?
12:19 <Onemorenickname_> it's a bit problematic for my program termination
12:19 Maxou joined
12:20 <JuanDaugherty> working the FFI will assuage ur Cness
12:21 <Onemorenickname_> hm, there has to be an efficient way to do it
12:21 <brynser> russellw: I just installed Haskell Platform on Windows and didn't see the lines in step 3 in my cabal config
12:22 <Onemorenickname_> JuanDaugherty, the lists are built in haskell
12:22 <JuanDaugherty> interface with some hoary thing, the default xml tools like xerces usw maybe
12:23 <Tuplanolla> Hey, are you the Brick man, JuanDaugherty?
12:23 zeroed joined
12:24 <JuanDaugherty> um, i don't think so
12:24 <Tuplanolla> There is another J. Daugherty then.
12:25 <Tuplanolla> What a coincidence.
12:25 <JuanDaugherty> there are indeed
12:25 <Rodenbach> Do lenses ship with ghc? Or are they an external lib?
12:25 <JuanDaugherty> even other Juan Daughertys
12:25 <cocreature> Rodenbach: external libs
12:25 <Rodenbach> k
12:25 insitu joined
12:26 <Tuplanolla> Are people with that name naturally drawn to Haskell or something?
12:27 <JuanDaugherty> Arthur Koestler, Roots of Coincidence
12:27 tommd joined
12:27 <JuanDaugherty> Jung on synchronicity
12:27 JanBessai joined
12:27 coot joined
12:28 saylu joined
12:29 lep-delete joined
12:29 ramzifu joined
12:29 ziocroc joined
12:30 merijn joined
12:32 dholbach joined
12:32 <absence> i'm using stack with lts-8.3 and get "GHC runtime linker: fatal error: I found a duplicate definition for symbol _js_decode_string" because it's defined in both aeson and json-stream, and then "ghc.EXE: panic! (the 'impossible' happened)". anyone seen this?
12:32 danthemyth joined
12:32 Jacoby6000__ joined
12:32 insitu joined
12:34 jchia_1 joined
12:34 danza joined
12:35 sepp2k joined
12:36 wlemuel joined
12:37 Maxou joined
12:37 <ertes> Onemorenickname_: when programming haskell, you shouldn't think in terms of "stuff in memory"… you should think in terms of haskell's semantics
12:38 <ertes> x = 1:x; y = 1:y -- these are the same list
12:38 <Onemorenickname_> ertes : yep, but that makes some thing highly impractical
12:38 deank joined
12:39 <Onemorenickname_> if i have to reason in terms of semantics :
12:39 <merijn> Well, sometimes you should think about stuff in memory, but only after you've learned how to do things without doing that :p
12:39 <ertes> Onemorenickname_: which things?
12:39 <Onemorenickname_> i have a big list
12:39 <Onemorenickname_> i have some function accessing multiple times items of the big list, and I want to make a small sublist from these access (without adding several time the same item)
12:39 <Onemorenickname_> one solution would be to have boolean marking on the big list for each function call
12:40 <ertes> Onemorenickname_: you want sharing?
12:40 <Onemorenickname_> and i don't see any other, as I can not check uniqueness
12:40 <Onemorenickname_> i don't know what is, so i will say no
12:41 <Onemorenickname_> (the big thing is an array, the small thing are lists)
12:41 <Onemorenickname_> (hence, I don't want something which require O(N) in space)
12:41 sykora joined
12:41 pleax joined
12:42 <Onemorenickname_> and if i can't compare recursive lists between them (semi-decidable) and can not use physical equality
12:42 <ertes> Onemorenickname_: for example if you have a Map or a Set, and you create a new one based on it, the new one will not be an actual memory-copy of the old one
12:42 <Onemorenickname_> ertes, ofc
12:42 <hiro`> brynser: Thanks. Actually stack ghci is still returning an error message, saying "Error parsing targets: The specified targets matched no packages."
12:42 <ertes> Onemorenickname_: the parts that didn't change will be shared, and that's fine in haskell, because values are immutable
12:42 <Onemorenickname_> (I expect that from functional languages)
12:42 <ertes> Onemorenickname_: that's what i mean by sharing
12:42 <Onemorenickname_> i see
12:42 <Onemorenickname_> that's not my problem then
12:43 haennar joined
12:43 <Onemorenickname_> I'm going to eat
12:43 <Onemorenickname_> And then make a minimal example
12:43 <Onemorenickname_> So it's easier to talk about it
12:44 Apocalisp joined
12:44 <ertes> Onemorenickname_: yeah, that would be useful
12:44 mbuf joined
12:44 asthasr joined
12:46 dbeacham joined
12:47 fizruk joined
12:47 HugoDaniel joined
12:49 tabaqui1 joined
12:51 <robertkennedy> Is there anyway in ghci to evaluate type functions?
12:51 <Xnuk> :t take
12:51 <lambdabot> Int -> [a] -> [a]
12:52 jchia_1 joined
12:52 <robertkennedy> I meant more like `F Char = Int`
12:52 zcourts joined
12:53 mattyw joined
12:54 <ertes> robertkennedy: :t undefined :: F Char
12:54 <ertes> GHCi seems to evaluate at least closed type families and type synonyms
12:55 <robertkennedy> Thats the best I got too. Tight, thanks.
12:56 doodlehaus joined
12:56 <ertes> robertkennedy: you can also guess what it evaluates to and have GHC check whether your guess was correct: () :: (F Char ~ Int) => ()
12:56 <ertes> if it was correct, it will just be quiet
12:57 <ertes> ah, it does actually print the ()
12:57 <ertes> pure () :: (Int ~ Int) => IO ()
12:58 xgley joined
12:59 fendor joined
13:00 <fendor> > foldl (/) 1 [5, 6, 10, 2] :: Expr
13:00 <lambdabot> mueval-core: Time limit exceeded
13:00 jchia_1 joined
13:00 <Onemorenickname_> ertes, I'm back, I'm making the small example
13:00 Jacoby6000__ joined
13:00 gmhafiz_ joined
13:02 ramzifu joined
13:03 insitu joined
13:07 <Onemorenickname_> ertes, i'm still making it, but the small example I made was too simple
13:08 electrocat left
13:08 cyborg-one joined
13:09 mattyw joined
13:10 Bish joined
13:10 <Onemorenickname_> well, the simplest example : a mutually recursive tree trasversal and looking at most one time each node
13:10 <Onemorenickname_> it basically amounts to that
13:11 jchia_1 joined
13:11 pavonia joined
13:12 pleax joined
13:12 <Onemorenickname_> a connex graph where a node is represented by its adjacency list
13:12 <Onemorenickname_> with no intermediate representation
13:14 haennar joined
13:14 sdothum joined
13:14 <ertes> Onemorenickname_: since i rarely work with graphs, take this with a grain of salt: i would probably name the nodes and keep a set of already visited nodes
13:14 <ertes> Onemorenickname_: but a nicer approach might be to use a zipper
13:14 <Onemorenickname_> ertes, the problem is that traversal are not in sync with one an other
13:15 <Onemorenickname_> so i'd have to keep many set of visited nodes at the same time
13:15 <Onemorenickname_> i'm looking online what a zipper is
13:15 <ertes> if they are mutually recursive, you can just pass the set around, can't you?
13:16 <Onemorenickname_> the traversals are not in sync
13:16 <Onemorenickname_> but a zipper looks like exactly what i need
13:16 <Onemorenickname_> i'm doing what i'm doing because i don't like the named approach
13:16 <Onemorenickname_> i can have non-addressed names and so on
13:16 <ertes> what do you mean by "not in sync"?
13:16 <ertes> they handle different parts of the graph?
13:17 <Onemorenickname_> like, traversal A will begin, then stop, then traversal B will begin, then A will continue etc.
13:18 <Onemorenickname_> oh, it's just one more argument and one more output
13:18 <Onemorenickname_> fair enough
13:18 <ertes> exactly
13:18 <ertes> in fact only one more argument, if they just use each other
13:18 <Onemorenickname_> (they don't)
13:18 <Onemorenickname_> i still don't like the O(N*m) space
13:18 <Onemorenickname_> i'm checking the zipper
13:18 <Onemorenickname_> it sounds very promising
13:18 jchia_1 joined
13:19 <ertes> Onemorenickname_: in any case you should (at least for the first year or so) drop the notion that values have a fixed memory address, or in fact a memory address at all
13:20 <ertes> values might live in your program only implicitly, either because of an optimisation or laziness
13:21 certainty joined
13:21 Bob8989 joined
13:21 osfameron joined
13:22 buglebudabey joined
13:22 fendor joined
13:22 <ertes> however, if you *want to*, you can do it the C way… we have explicit allocation and pointers, but they're mostly used for FFI stuff
13:23 ajhager joined
13:23 Dnthr joined
13:23 <russellw> Given a tool like this https://hackage.haskell.org/package/hfmt that says you can install either with Cabal or Stack, which should I use?
13:23 <Onemorenickname_> ertes, i'm trying to find a better way
13:24 <russellw> I'm running on Windows, if that makes a difference
13:24 <Onemorenickname_> if i'm in #haskell, at least i can find a not-C way
13:24 refold joined
13:25 vadimich joined
13:25 vadimich joined
13:27 Iskarlar joined
13:27 Miroboru joined
13:28 Bob8989|2 joined
13:28 vadimich joined
13:29 vadimich joined
13:31 ziman joined
13:32 Ch3ck joined
13:33 lukaramu_ joined
13:33 <ertes> Onemorenickname_: another option could be to design your algorithm such that you can't walk the same path twice by removing the edges during your traversal
13:34 <ertes> but i don't know how efficient that would be… you would need to handle dead-ends by backtracking
13:34 <ertes> but you're probably doing that anyway
13:34 <Onemorenickname_> actually, it's a parsing algorithm
13:34 <Onemorenickname_> so the graph is an algebraic grammar graph
13:34 <Onemorenickname_> and there /many/ traversals
13:35 <Onemorenickname_> not easy to remove edges :(
13:35 k0001 joined
13:35 <ertes> ah, i see
13:35 <ertes> something that can't be done with parser combinators?
13:35 <Onemorenickname_> there are many things
13:36 <Onemorenickname_> i want to be able to plug hooks on partial parsings
13:36 <Onemorenickname_> it will be modified from outside
13:36 <Onemorenickname_> (by user input)
13:36 <Onemorenickname_> and, i want to plug hooks on "character consuption"
13:36 <ertes> so the grammer itself changes dynamically in response to concurrent user input?
13:36 <Onemorenickname_> yep
13:36 jnj joined
13:37 <Onemorenickname_> (the hooks on character consumption are so I can make optimization based on my knowledge)
13:37 <ertes> well, at least megaparsec has a transformer variant, but as far as i see it can't handle incremental input
13:37 <ertes> trifecta can handle incremental input, but doesn't have a transformer variant
13:37 <jnj> Any thoughts on how to avoid a seemingly "wrong" warning?: http://lpaste.net/353124
13:38 <Onemorenickname_> ertes : basically, i'm making a dynamic language, and I want to provide high level parsing primitives
13:38 <ertes> attoparsec is the only combinator library i know that can do both, but it's specialised to efficiently parsing machine-generated stuff
13:38 oaaao joined
13:38 <Onemorenickname_> i'm willing to use any language to make, hence my presence here
13:38 <ertes> Onemorenickname_: i would probably create a combinator library
13:38 <merijn> ertes: attoparsec doesn't have a transformer variant either, does it?
13:39 <ertes> merijn: doesn't it? wait
13:39 <merijn> ertes: It never has had that
13:39 Miroboru joined
13:39 <ertes> crap, you're right
13:39 <ertes> yeah, custom combinator library then
13:40 indi_ joined
13:41 chlong_ joined
13:41 mbw joined
13:41 <Onemorenickname_> ha ha
13:41 <Onemorenickname_> 1500 on #haskell, niice
13:42 lak joined
13:42 wei2912 joined
13:43 indi_ joined
13:44 <mbw> Hello everybody, I have a question regarding desugaring list comprehensions. If you take a naive matmul implementation with: dotProd v w = sum (zipWith (*) v w); matmul a b = [ map (dotProd row) (Data.List.transpose b) | row <- a ], is it possible to express this using nested do notation?
13:45 lithie joined
13:45 mjs2600 joined
13:45 <mbw> v, w :: Num a => [a]; a, b :: Num a => [[a]]
13:46 <cocreature> mbw: you can’t express zipWith using do notation (well using ApplicativeDo and ZipList you probably can but that’s another topic)
13:46 grayjoc joined
13:47 contiver_ joined
13:47 <mbw> The dotProd can stay. But I thought I should be able to express applying the partially applied (dotProd row) to each row of (transpose b).
13:49 <mbw> So I thought that it would somehow be possible to do row <- a in a do block, and in a nested do block have something like row' <- (transpose b); return $ dotProd row row'.
13:49 <ertes> > [ replicate n c | n <- [1..4] | c <- "abcd" ]
13:50 <lambdabot> ["a","bb","ccc","dddd"]
13:50 <cocreature> mbw: sure, that should work exactly like you described
13:50 <mbw> I can't get it to parse :(
13:50 keutoi joined
13:51 HugoDaniel joined
13:51 <mauke> better not tell us what the error is, otherwise we might be able to help you
13:52 <mbw> mauke: I am currently trying to phrase it in a manner suitable for discussion, sorry for the delay
13:52 <cocreature> mbw: http://lpaste.net/353125
13:52 <mauke> why not just post your code and the error message?
13:52 <cocreature> however, I don’t think replacing map by do notation is useful
13:52 insitu joined
13:52 <cocreature> eh you probably need a return around the last do block
13:53 <mauke> yeah, I was about to say
13:53 <cocreature> that’s what I get for not adding types
13:53 zcourts joined
13:53 <russellw> Okay so I'm using Stack because Google search results seemed to say it was better. It's been updating package index for about ten minutes now, which I wasn't expecting. Is it supposed to be doing that?
13:53 <mauke> don't need types if you're a text rewriting system :-)
13:54 kyle1320 joined
13:55 <mbw> Ah, the return $ do ... part does it.
13:55 <cocreature> the return is not necessary for it to parse. it’s “just” necessary for it to do the right thing :)
13:56 sevensor joined
13:56 buglebudabey joined
13:58 <mbw> Now that I think of it, that wasn't really that hard.
13:58 indi_ joined
13:58 cpennington joined
13:59 coot joined
13:59 soLucien joined
13:59 <mbw> And regarding replacing map: That's not what I want to do, I just want to be able to do some transformation, playing around with it.
14:00 <mbw> Anyway, thanks for your help!
14:01 JanBessai joined
14:01 chris2_ joined
14:03 mjs2600 joined
14:03 mada joined
14:06 tomphp joined
14:06 danthemyth joined
14:06 indi_ joined
14:06 igniting joined
14:07 mohsen_ joined
14:07 KarboniteKream joined
14:08 ccomb joined
14:09 harfangk joined
14:10 dfeuer joined
14:11 ingex joined
14:14 crobbins joined
14:16 cdg joined
14:16 Maxou joined
14:18 Bane^ joined
14:19 carlomagno joined
14:19 jomg joined
14:20 hazmat_ joined
14:20 Maxou_ joined
14:21 doodlehaus joined
14:21 Miroboru joined
14:22 csaurus joined
14:24 mrkgnao joined
14:25 meba joined
14:26 cdg joined
14:27 doodlehaus joined
14:27 Bane^ joined
14:27 tommd joined
14:29 doodlehaus joined
14:29 ChristopherBurg joined
14:29 Argue joined
14:30 fendor joined
14:30 mnoonan joined
14:30 contiver_ joined
14:31 MattWest joined
14:31 ystael joined
14:31 doodlehaus joined
14:32 jmg8766 joined
14:32 halogenandtoast joined
14:33 pleax joined
14:33 mizu_no_oto_work joined
14:35 rekahsoft joined
14:37 kakashiAL joined
14:38 <iainhallam> Is anyone available to help me build Haskell from source on CentOS 7?
14:38 lak joined
14:39 <iainhallam> The README in the platform source distribution appears to contradict itself several times and I haven't been able to get platform.sh to run.
14:39 freusque joined
14:39 dec0n joined
14:39 <johnw> iainhallam: just wondering, but would it be at all possible to run your Haskell application from Docker?
14:39 <johnw> this is what I do, rather than figure out building on CentOS 7
14:39 jmg8766 left
14:40 <iainhallam> I'm a sysadmin, and I have to install it for use across 100 teaching machines.
14:40 <johnw> ahh
14:40 <merijn> iainhallam: Why are you trying to build from source?
14:40 <merijn> iainhallam: Why not just install the binary dist?
14:40 <johnw> are you going to prepare an .rpm?
14:40 insitu joined
14:41 <iainhallam> Because the installer doesn't want to put it anywhere other than /usr/local.
14:41 fendor joined
14:41 <iainhallam> Eventually going to package to RPM, yes.
14:42 <iainhallam> My target is /opt/haskell/8
14:43 <merijn> iainhallam: Wut?
14:43 <ertes> there are at least 20 CentOS machines in the world that have a /nix directory, because a certain ertes didn't want to bother figuring out haskell deployment on CentOS =)
14:43 jeltsch left
14:43 <merijn> I'm using GHC on Scientific Linux, which I'm pretty sure is retarded old CentOS and it Just Works
14:43 <c_wraith> ertes: do you know where that ertes is?
14:44 contiver joined
14:44 mjs2600 joined
14:44 <iainhallam> @merijn: Why "wut?"?
14:44 <lambdabot> Unknown command, try @list
14:44 <merijn> Download bindist, run "./configure --prefix=~/opt/", "make install" and it just works
14:45 <merijn> Replace --prefix with whatever you want
14:45 <ertes> c_wraith: err…
14:45 <iainhallam> Of the whole platform?
14:45 <merijn> oh, dunno about platform
14:45 <merijn> I just install GHC + cabal
14:45 <c_wraith> if you're doing your own setup, why care about the platform?
14:45 <c_wraith> Just install what's actually needed
14:46 <iainhallam> Because we have a bunch of lecturers who know that their teaching works with platform, and otherwise we'd have to maintain a separate list of requirements for teaching every course, which will cause a lot more work in testing each time.
14:47 <iainhallam> Given that I don't use Haskell myself, and they are hard pushed for time as it is, I'd prefer to avoid asking them all to maintain such a list of requirements
14:47 EvilMachine joined
14:48 <c_wraith> the problem is that the number of people who care about the platform is very small in comparison to the number of people who use haskell.
14:48 <iainhallam> Ah, right.
14:48 <iainhallam> Am I approaching this wrong, then?
14:48 sternmull joined
14:49 <iainhallam> What's the best way to get a modern GHC and a bunch of modules to each PC?
14:49 <merijn> Also, the number of people who care about both CentOS and platform is probably epsilon :p
14:49 <iainhallam> Platform seemed like a nice easy way forward, but then it turns into a quagmire of problems to get running in our setup.
14:50 <c_wraith> What problems do you actually encounter?
14:50 <iainhallam> For starters, the README in the distributions suggests that I need a working ghc, cabal and stack to do the install, but then says that if I check out the GitHub repo, I only need a bindist.
14:50 <ertes> doesn't CentOS provide packages for GHC and cabal-install by itself?
14:51 <iainhallam> CentOS provides GHC 7.6
14:51 <c_wraith> Ouch
14:51 <ertes> ouch
14:51 <iainhallam> Somewhat old.
14:52 <iainhallam> Then the README suggests that to install I should run platform.sh with arguments for a bindist tarball, path to cabal and path to stack, even when I have the repo version.
14:52 <iainhallam> It's a little confusing - I'm used to running configure/make to get stuff built.
14:52 <c_wraith> if you install a recent ghc bindist, does that work by itself?
14:52 alfredo joined
14:52 <ertes> yeah, i'd go for binaries, too
14:53 <brynser> There's a generic linux download here https://www.haskell.org/platform/linux.html#linux-generic
14:54 <iainhallam> brynser: That's what I'd been hoping to use
14:54 zcourts joined
14:54 <iainhallam> But if you try to tell it a new prefix, it fails silently, because the scripts redirect errors to /dev/null
14:54 <c_wraith> odd, I've used that installer with alternate prefixes all the time
14:54 <brynser> Oh :(
14:54 alx741 joined
14:54 <iainhallam> It only supports /usr/local/ghc-n.n.n, which is off limits in our setup.
14:55 <iainhallam> c_wraith: where does it put the symlinks in that case?
14:55 <c_wraith> It doesn't.. I've always created them myself.
14:56 <iainhallam> https://github.com/haskell/haskell-platform/issues/234 is open for supporting non-/usr/local installs.
14:56 coltfred joined
14:56 <iainhallam> And the scripts that would get linked into /usr/local/bin contain the hardcoded path to /usr/local as well.
14:57 dsh joined
14:57 mjs2600 joined
14:57 <c_wraith> This is bizarre, because I build it with a prefix $HOME/ghc-n.n.n all the time
14:57 <iainhallam> What command line do you use?
14:58 <c_wraith> ./configure --prefix=$HOME/ghc-whateverversion ; make install
14:58 nilg joined
14:58 monadicDuck joined
14:58 shinX joined
14:58 <iainhallam> Ah, I'm talking about the platform binary distribution.
14:59 <iainhallam> Which has install-haskell-platform.sh as its installer.
14:59 nycs joined
14:59 Maxou joined
14:59 <c_wraith> Oh. Yeah, I'm saying to skip that. Just install ghc, cabal, and then do global installs on the packages included in the platform.
14:59 <c_wraith> It seems easier than fighting with the platform's installer
15:00 <iainhallam> This is going to be fun to automate!
15:00 <c_wraith> It's not actually that bad.
15:00 <iainhallam> :)
15:00 nilof_ joined
15:01 <c_wraith> you can pass cabal a list of simultaneous targets, so it's really just one command. With a very long command line
15:01 <iainhallam> At least I can get a script to build that.
15:02 <c_wraith> You might be able to make a binary .rpm out of it so that you don't need to run the build on every machine, too
15:02 <iainhallam> I've done that with quite a few other packages using an automated packaging system we've written.
15:02 dgonzo joined
15:03 <c_wraith> There are some things to watch out for, though. For this use case, you want to install packages into the global package directory, not your user-local one.
15:03 psychicist__ joined
15:04 <iainhallam> So the configure shipped with GHC 8.0.2 seems to be using something linked to libgmp.so.3
15:04 <c_wraith> ah, there is the libgmp problem. :(
15:04 <iainhallam> On CentOS 7 I have only libgmp.so.10!
15:05 <iainhallam> You say that like it's a known thing :o)
15:05 <c_wraith> libgmp is a source of problems, yeah
15:06 leah2_ joined
15:06 pasukon joined
15:06 sobaken joined
15:07 soLucien joined
15:07 <c_wraith> Interesting. Are you not on Centos 6.7?
15:07 <iainhallam> No - CentOS 7.3
15:07 <iainhallam> D'oh!
15:07 <iainhallam> Just seen the filename I downloaded.
15:07 dabd joined
15:08 <c_wraith> Well then. Stupid as it sounds, try the debian 7 version.
15:08 darkrose_ joined
15:08 <dabd> I installed the haskell layer for spacemacs but I can't figure how to start ghci. Can someone please give me a help?
15:08 cyphase joined
15:09 cdg_ joined
15:09 Claudius1aximus joined
15:11 doux joined
15:12 cpup joined
15:13 Guest76598 joined
15:14 hazmat_ joined
15:14 fendor joined
15:14 GBrawl joined
15:17 tommd joined
15:18 <iainhallam> Amazingly that Debian 7 version is configured!
15:18 revtintin joined
15:19 <iainhallam> That seems like it needs documentation updates at the very least :o)
15:19 <c_wraith> I thought there was a good chance it would work. Kind of dumb, but the main difference between the different versions is what libgmp and libc they are built against.
15:19 codesoup joined
15:19 uglyfigurine joined
15:20 tsahyt joined
15:20 <c_wraith> iainhallam: I've got to run, but I expect lots of others will help out
15:20 kubunto joined
15:21 <iainhallam> Thanks!
15:21 Fairy joined
15:21 eklavya joined
15:21 <iainhallam> If this works, I'm just figuring out the cabal commands to get a full install.
15:21 <c_wraith> oh, I was going to warn you - when doing a global install, don't sudo cabal. It tends to make libraries unusable to non-root users
15:22 <kubunto> if i have a datatype of Digit a, how would i write an fmap function to transform it?
15:22 <c_wraith> Instead, tell cabal to use sudo as the root command when installing. There's a command-line flag for that, which I don't recall offhand
15:22 Claudius1aximus joined
15:22 robotroll joined
15:22 <iainhallam> Good to know.
15:23 <Tuplanolla> Is there an easy solution to moving and renaming modules?
15:23 _sg joined
15:23 <merijn> Tuplanolla: Just move them and wait for compiler errors?
15:23 <Tuplanolla> Then I need to go through all the other files that depend on them.
15:24 JanBessai joined
15:24 buglebudabey joined
15:24 <Tuplanolla> I fondly remember Eclipse doing this automatically for Java.
15:25 e14 joined
15:26 <Tuplanolla> I'll have to pitch this next time someone asks for a learning project idea.
15:27 osa1 joined
15:27 osa1 joined
15:30 Wizek joined
15:30 Wizek_ joined
15:30 robkennedy joined
15:31 cschneid_ joined
15:31 insitu joined
15:31 trism joined
15:33 BeiZero joined
15:34 animated joined
15:34 KarboniteKream joined
15:34 <nitrix> kubunto: How is your data type declared?
15:35 ludat joined
15:35 <cocreature> Tuplanolla: I’ve done module renaming using sed :)
15:36 <Tuplanolla> I just did the equivalent, but shuffling the buffers in Vim is also annoying, cocreature.
15:36 <nitrix> kubunto: I have trouble imaginating a parametric `Digit a` type when its goal is to represent a digit. What would be the meaning of `Digit String` or `Digit Bool` ?
15:36 <Tuplanolla> I lose all marks etc.
15:36 HarveyPwca joined
15:36 <cocreature> Tuplanolla: yeah I wasn’t suggesting this is a good solution
15:37 mjs2600 joined
15:37 <kubunto> nitrix: digit wraps int
15:37 kyle1320 joined
15:37 <nitrix> kubunto: Maybe data Digit = D Int, would make more sense?
15:37 bennofs joined
15:37 <Tuplanolla> Should just stop coming up with bad names in the first place.
15:38 <c_wraith> it's funny how the super-static nature of haskell makes it conceptually straight-forward to write all kinds of refactoring tools - and at the same time provides a relatively low incentive to do so because doing it wrong by hand usually results in compiler errors that tell you what to fix.
15:38 msko joined
15:39 insitu joined
15:40 contiver joined
15:41 stelleg joined
15:41 <nitrix> kubunto: If it isn't algebraic, you might as well use newtype. newtype Digit a = D Int. You could automatically let GHC derive the Functor instance for you with `deriving Functor`, but it wont make much sense since it's the type of that `a` that's varying. You have a phantom type.
15:42 miklcct_ joined
15:42 <nitrix> kubunto: I do not recognise this as a useful functor, but I could be mistaken.
15:42 uglyfigurine joined
15:43 chrisdotcode joined
15:43 <c_wraith> nitrix: it comes up sometimes.
15:44 <nitrix> kubunto: fmap for `Digit Bool` would infer as fmap :: (Bool -> b) -> f Bool -> f b
15:44 <nitrix> kubunto: Is this what you're after?
15:44 <c_wraith> nitrix: it's isomorphic to Const Int a
15:44 afarmer joined
15:44 <nitrix> c_wraith: Yeah.
15:44 k0001 joined
15:44 <c_wraith> nitrix: and we know Const is useful in the lensoverse :)
15:45 <nitrix> c_wraith: Just a tingly feeling from the level of the question that this might not be what they want.
15:45 <kubunto> nitrix: what i want is a way to transform the number within the digit struct using fmap
15:45 <c_wraith> nitrix: hey, you're right!
15:45 <c_wraith> kubunto: fmap isn't a good choice for that
15:45 <johnw> kubunto: that isn't what Functor does; but lenses can do that
15:45 Maxou joined
15:45 <c_wraith> kubunto: since fmap requires being able to change the type arbitrarily
15:45 <johnw> also, MonoFunctor could do that
15:46 <nitrix> kubunto: What you're describing isn't a Functor. The type of what is changing has to be parametric.
15:46 <kubunto> should mention the larger goal of this is to learn more about monads and functors
15:47 grayjoc joined
15:47 <kubunto> if a graph data structure doesnt play well with functors then i would love to know what would
15:47 <aweinstock> does unsafeDupablePerformIO have any proof obligations/invariants other than thread-safety/purity?
15:48 steeze joined
15:48 saylu joined
15:50 louispan joined
15:50 umib0zu joined
15:50 <johnw> kubunto: graphs over arbitrary node types play very well with functors
15:50 Maxou joined
15:51 <nitrix> kubunto: I recommend you to implement the functor instance of the Maybe type.
15:52 <nitrix> kubunto: data MyMaybe a = Just a | Nothing
15:52 argent0 joined
15:52 wraithm joined
15:52 <nitrix> Oh I guess you'd need *MyJust *MyNothing
15:53 <nitrix> kubunto: Name it something different from the existing Maybe type and its constructors and see if you can come up with the functor implementation.
15:54 tsmish joined
15:54 <kubunto> nitrix: where is pattern matching in relation to functors?
15:54 dhil joined
15:54 <nitrix> kubunto: It's probably easier to implement some of these first to build some intuition, then look into what is and isn't a functor.
15:54 Fairy joined
15:55 zcourts joined
15:55 csaurus joined
15:56 wraithm joined
15:56 pleax joined
15:56 <nitrix> kubunto: Well, for an algebraic data type to be useful, it's going to have a constructor. And working with that data type (like defining instances that manipulates it) will require you to unwrap/rewrap something at some point, to make it of the type MyMaybe.
15:56 <nitrix> kubunto: e.g. 42 :: Int, MyJust 42 :: MyMaybe Int.
15:57 ibKH joined
15:57 jaffachief joined
15:57 <kubunto> nitrix: i played with that concept in tree form the other day
15:57 <nitrix> kubunto: You can see the difference in type here, which is caused by us constructing a value of type `MyMaybe Int` using the MyJust constructor.
15:57 <kubunto> using a pattern matcher to unwrap values
15:58 <nitrix> kubunto: Same thing happens in reverse when you're deconstructing (pattern matching) the data type to work on it.
15:58 <nitrix> kubunto: But to answer your question, it's not a requirement of *functors*, just an Haskell data type thing.
15:59 <nitrix> kubunto: Here's an easier one for you: data Simple a = MkSimple a
16:00 <nitrix> kubunto: Can you figure out how to implement fmap for this :) ?
16:00 <kubunto> fmap would unwrap and re wrap?
16:01 <nitrix> Yeah, you'd have to unwrap that Simple type, apply the transformation, then rewrap it.
16:01 hackebeilchen joined
16:01 stites joined
16:02 <nitrix> Effectively transforming what's "inside" of Simple.
16:02 chlong__ joined
16:02 <merijn> johnw: And here I am representing my graphs as just arrays of numbers :p
16:02 eschnett joined
16:03 <kubunto> nitrix: i could figure a pattern matching function yes
16:03 <nitrix> kubunto: Try it :P Then we can try more complicated ones or see why some types can be functors and others cannot.
16:04 refold joined
16:05 jathan joined
16:06 stites_ joined
16:06 Rodya_ joined
16:06 sellout- joined
16:08 doodlehaus joined
16:09 mizu_no_oto_work joined
16:10 <nitrix> kubunto: You can compare you answer with mine (http://lpaste.net/353130)
16:10 <kubunto> nitrix: i made curried functor for simple
16:10 <nitrix> A curried functor?
16:11 <kubunto> the function was fsimple f a
16:11 <kubunto> used a pattern match to unwrap it and returned it in the same data structure
16:11 JanBessai joined
16:12 <nitrix> You can just paste your line.
16:12 Argue_ joined
16:12 <kubunto> MkSimple a -> MkSimple $ f a
16:13 <nitrix> That doesn't seems quite right. Where's your function definition? Where does `f` comes from? If it's a lambda, the syntax isn't correct either.
16:14 dhil joined
16:14 Wuzzy joined
16:14 <nitrix> fmap f (MkSimple x) = MkSimple (f a)
16:14 <kubunto> http://lpaste.net/353131
16:14 <nitrix> fmap f (MkSimple x) = MkSimple (f x)
16:15 <nitrix> kubunto: There you go :D
16:15 cschneid_ joined
16:15 <kubunto> what is this instance thing?
16:15 stites joined
16:15 kyle1320 joined
16:16 <nitrix> kubunto: Two details here. (1) You didn't define the functor instance, you created a completely new function named fsimple, when you're supposed to be implementing the `fmap` function of the `Functor` type class, via in instance for your Simple type.
16:16 doomlord joined
16:17 <nitrix> (2) That means getting rid of the extension DeriveFunctor and the `deriving` keyword, they aren't doing anything for you there and probably best to ignore until you're comfortable with functors.
16:17 insitu joined
16:18 <nitrix> kubunto: I did like the creative use of `case of` though for the pattern matching, but you can achieve the same by pattern matching the arguments of your function definition directly (left hand side of = ).
16:19 Onemorenickname joined
16:19 KarboniteKream joined
16:20 wraithm joined
16:20 raycoll joined
16:21 <nitrix> Your solution hints me you need a slightly better intuitions of type classes. Type classes are a regroupment of types that have a property in common. Usually we leverage that property by providing a common interface for such types (so, a polymorphic function that works for any of the types that defines an instance for that type class).
16:21 <nitrix> kubunto: Are you familiar with Java interfaces, possibly?
16:21 <kubunto> that comes from scala
16:22 <nitrix> What "comes" ?
16:22 FullyFunctional left
16:22 <kubunto> nitrix: i know pattern matching because of familiarity with scala
16:22 <nitrix> Gotcha :P
16:23 urodna joined
16:23 kuribas joined
16:23 <nitrix> kubunto: In other words, for the user to be able to use `fmap` on a value of type `Simple`, the author of `Simple` has to define the instance `Functor Simple`.
16:24 zero_byte joined
16:24 <ongy> I have a withFile and us hGetContents in it, iirc that's dangerous because of lazy-IO. I want to return an IO Int, what's the best way to force the evaluation of the Int so I know all IO has been done before withFile returns?
16:25 <glguy> ongy: You can use Control.Exception.evaluate on the resulting Int inside the withFile.
16:26 stites joined
16:26 gienah_ joined
16:26 <merijn> ongy: Depends, which hGetContents?
16:27 insitu joined
16:27 <ongy> glguy: ah looks good to me. merijn Prelude.hGetContents (for now)
16:27 oisdk joined
16:27 <merijn> ongy: hGetContents is only lazy IO for String and lazy Text/BS
16:27 <merijn> ongy: strict Text and BS use a strict hGetContents
16:27 <nitrix> kubunto: Maybe you want to give it another try? You seem like you're pretty close for it all to click :)
16:28 <ongy> merijn: oh, good to know
16:28 <ongy> and makes a lot of sense. But I will use String for now
16:29 <kubunto> http://lpaste.net/353132 nitrix
16:29 serendependy joined
16:29 <kubunto> is fmap supposed to loop over a collection as well?
16:29 <nitrix> kubunto: Assuming data Foo a = Baz | Bar a ?
16:29 <kubunto> nitrix: yup
16:30 <nitrix> kubunto: If that's what you want it to do, sure. The functor instance of [] does this.
16:30 <nitrix> > fmap (+1) [1,3,5]
16:30 <lambdabot> [2,4,6]
16:30 raynold joined
16:31 <kubunto> nitrix: i tried fmap (^2) [Bar 4, Baz] with no luck
16:31 <nitrix> @let data Foo a = Baz | Bar a
16:31 <kubunto> would have expected [Bar 16, Baz] back
16:31 <lambdabot> Defined.
16:31 skeet70 joined
16:31 Luke joined
16:31 <nitrix> > (fmap . fmap) (^2) [Bar 4, Baz]
16:31 <lambdabot> error:
16:31 <lambdabot> • Could not deduce (Functor Foo) arising from a use of ‘fmap’
16:31 <lambdabot> from the context: Num b
16:32 <nitrix> Oh I forgot the functor instance.
16:32 <nitrix> kubunto: You need two fmaps. There are two functors. The [] functor and then the Foo functor.
16:32 <nitrix> They're nested.
16:32 <kubunto> ah
16:33 Gabemo joined
16:35 stites joined
16:36 stites joined
16:36 <kubunto> nitrix: i am not seeing how to get it recursive
16:36 <kubunto> like in a tree traversal
16:37 <nitrix> kubunto: It can only be recursive for its own type (itself), if that's what you mean. Which is what recursive is.
16:37 <nitrix> In the [] and Foo example, they aren't recursive, they're simply nested.
16:38 certainty joined
16:38 tommd joined
16:38 <nitrix> kubunto: Try a binary tree first, maybe? data Tree a = End | Node (Tree a) a (Tree a) ?
16:38 <kubunto> nitrix: i was doing data Tree a = Leaf a | Branch a (Maybe (Tree a)) (Maybe (Tree a))
16:38 <kubunto> without the maybes
16:38 <Onemorenickname> hi
16:38 <Onemorenickname> i guess i kinda managed my grammar problem
16:39 <nitrix> kubunto: So you had what I just wrote, minor your leaves have a value in your example. You don't really need it but it's up to you.
16:39 <Onemorenickname> for those interested, all my grammar have now a context, and such, different grammars in different contexts can have the same name
16:39 <Onemorenickname> yay
16:40 <Onemorenickname> i lose some static checking, still, i have my most desired property
16:40 <nitrix> kubunto: data Tree a = End | Node (Tree a) a (Tree a)
16:40 <nitrix> kubunto: fmap f End = End
16:40 simukis__ joined
16:40 <nitrix> kubunto: fmap f (Node leftTree value rightTree) = ...
16:40 stites joined
16:41 <nitrix> kubunto: Does that helps?
16:41 stites joined
16:41 <nitrix> You should be able to figure out how to transform the current value, as well as continue the transformation on the left side and right side of the tree as well.
16:42 rubbish joined
16:42 Gurkenglas joined
16:43 <kubunto> nitrix: i am seeing if i can do it with 2 types
16:43 <kubunto> Tree a b
16:44 <nitrix> kubunto: You'll have a hard time.
16:44 sjakobi joined
16:44 <nitrix> kubunto: `Tree a b` has the wrong kind to be a functor.
16:44 <nitrix> kubunto: Given `Tree a b`, only (Tree a) can be a functor.
16:44 jao joined
16:45 jmelesky joined
16:46 <kubunto> nitrix: why
16:46 <nitrix> Again it's probably best to build a minimal intuition of how to use and create functors... at least to be able to write simple programs, and then slowly learn what is and isn't a functor.
16:46 <nitrix> kubunto: The explanation will fly above your head but:
16:46 trevb joined
16:47 <nitrix> kubunto: The kind of `Tree a b` is `* -> * -> *`. It's a type constructor that expects two other concrete types and produces a concrete type.
16:47 <nitrix> kubunto: class Functor (f :: * -> *) where fmap :: (a -> b) -> f a -> f b
16:48 <kubunto> it isnt (a b -> c d)
16:48 <nitrix> kubunto: The `f` required for `Functor` needs to be a type constructor with kind `* -> *` (taking only a single type as argument, not two).
16:48 <nitrix> kubunto: Your notation isn't correct but I get what you're trying to describe.
16:48 <nitrix> That'd be a Bifunctor.
16:48 allegorical joined
16:48 xocolatl joined
16:48 <kubunto> sounds like a headache
16:48 <nitrix> And they work differently. Their interface is much different too.
16:49 <nitrix> bimap f g v
16:49 <nitrix> For Bifunctors, there are two transformation functions, rather than one.
16:50 mjs2600 joined
16:50 <nitrix> I can understand the reaction. Without proper understanding of Functor, it's probably hard to conceptualize why would someone even want Bifunctor, or some infinite functor.
16:50 oisdk joined
16:51 <kubunto> nitrix: whats wrong with this: http://lpaste.net/353133
16:51 <nitrix> I'm afraid that reasoning is due to not understanding what functors are used for. You might be conflating records / product types, with functors, which promises something else entirely.
16:51 <nitrix> kubunto: But, we're slowly building an intuition now, so that's awesome :D
16:53 jaffachief left
16:53 <nitrix> kubunto: Checking
16:54 <nitrix> That seems doable.
16:54 <nitrix> @let data Equation d = Digit d | Operator d (Equation d ) (Equation d)
16:54 <lambdabot> Defined.
16:54 <nitrix> @let instance Functor Equation where fmap f (Digit d) = Digit (f d); fmap f (Operator a b c) = Operator a (fmap f b) (fmap f c)
16:54 <lambdabot> .L.hs:174:47: error:
16:54 <lambdabot> • Couldn't match type ‘b’ with ‘a’
16:54 <lambdabot> ‘b’ is a rigid type variable bound by
16:55 <kubunto> yea thats what i got
16:55 <glguy> The f for functor doesn't even need to be a type constructor
16:55 tristero joined
16:55 tristero joined
16:55 <glguy> Something like 'Either ()' will do, too
16:56 <nitrix> glguy: That has kind `* -> *`, no? Isn't that a type constructor?
16:56 <glguy> No, Either and () are type constructors
16:56 <glguy> Type constructor is a category of names, nothing to do with kinds
16:56 <nitrix> glguy: Ah interesting point of view.
16:57 <glguy> It's just the definition, not really a point of view
16:57 <nitrix> glguy: Is there a useful name to describe `Either ()` ?
16:57 Fairy joined
16:57 <nitrix> Partially applied type constructor :3 ?
16:57 <glguy> It's a type with kind * -> *
16:57 <Cale> It's a type of kind * -> *
16:57 <nitrix> Ah okay.
16:57 Kreest__ joined
16:57 <kubunto> nitrix: i know the either thing
16:57 <kubunto> left a | right b
16:57 <Cale> You could call it a type function if you like
16:58 <nitrix> Cale: I had always associated type construtor with type function mentally, but I now see that a distinction is needed.
16:58 fendor joined
16:59 boombanana joined
16:59 <glguy> It's analogous to the value level with constructors Just and True where types don't factor in
17:00 <nitrix> glguy: Does this has a correlation with FlexibleInstances?
17:00 <glguy> I suppose. Haskell says that instances should specify one type constructor applied to zero or more type variables
17:00 <nitrix> glguy: e.g. GHC whining that the pattern for the instance must have the form `T a1 ... am` ?
17:00 <glguy> Flexible instances loosens that to allow being applied to other type constructors
17:01 <kubunto> nitrix: still cant get the recursive part of the fmap to work
17:01 <glguy> or even other non-variable types
17:01 <glguy> like (f a)
17:01 <nitrix> So isn't it okay to call it a type constructor?
17:01 <glguy> To call what a type constructor?
17:01 buglebudabey joined
17:01 <nitrix> Either applied on (), I doubt that it's less of a type constructor just because it's being applied an argument.
17:02 <glguy> No, it's still nothing to do with being a type constructor
17:02 <glguy> flexible instances looses the restrictions on making instances, not on what a type constructor is
17:02 <glguy> There are type constructors: Either Bool () (->), and there are type variables a b c d e...
17:02 <glguy> from those you can form more interesting types via application
17:03 <nitrix> I see, what you're saying is the report would just say `T` as the pattern if `Either ()` was a type constructor and get away with just saying it has to be a type constructor.
17:03 <nitrix> Instead, it specifies `T a1 .. am` such that you need a type constructor AND one or more type variables.
17:04 <glguy> zero or more
17:04 afarmer joined
17:04 <nitrix> Wait you said zero earlier. Why is the pattern `T a1 .. am` then?
17:04 <glguy> m can be 0
17:04 <glguy> Consider: Show Int
17:04 <nitrix> a1 .. a0 ?
17:04 <glguy> T is Int there
17:04 <nitrix> That's an odd range.
17:06 <nitrix> glguy: I'll try to remember.
17:06 handyc joined
17:07 ludat joined
17:08 <nitrix> glguy: Cale I appreciate the correction :)
17:08 coot joined
17:08 mwilly joined
17:09 <mwilly> ThisPasswordIsNotGood@All
17:09 <kubunto> hehe
17:09 revprez joined
17:09 [scrooge] joined
17:10 <kubunto> nitrix: glguy still lost on the recursive fmap call
17:10 <dgpratt> not anymore it ain't
17:10 theelous3 joined
17:10 SomeT joined
17:12 al-damiri joined
17:14 mbrane joined
17:14 fendor joined
17:15 Shabbypenguin joined
17:15 <absence> i'm using stack with lts-8.3 and get "GHC runtime linker: fatal error: I found a duplicate definition for symbol _js_decode_string" because it's defined in both aeson and json-stream, and then "ghc.EXE: panic! (the 'impossible' happened)". anyone seen this?
17:15 sowparnik joined
17:16 Sonolin joined
17:16 mwilly joined
17:17 slaterr joined
17:17 mwilly left
17:17 keutoi joined
17:17 mbrane joined
17:17 mwilly joined
17:20 acidjnk joined
17:21 <kubunto> anyone know about recursive fmaping
17:21 <mnoonan> maybe?
17:21 <mnoonan> what are you trying to do?
17:22 <kubunto> i am trying to get this to work: http://lpaste.net/353133
17:22 coltfred joined
17:22 <jle`> kubunto: we need to know the definition of Equation
17:23 <kubunto> jle`: see title
17:23 <kubunto> it is my bad but it is there
17:23 <jle`> ah i see.
17:23 <jle`> well, what is the error?
17:24 mizu_no_oto_work joined
17:24 pleax joined
17:24 wildlander joined
17:24 <kubunto> jle`: http://lpaste.net/353135
17:24 Lord_of_Life joined
17:25 <glguy> kubunto: In the expression "Operator x (fmap f y) (fmap f z)", x has type 'a', but a value of type 'b' is needed
17:25 <jle`> yeah, i'd probably use different variable names
17:25 xall joined
17:26 doomlord joined
17:26 <glguy> so you need to think of a value with type 'b' to fit into "Operator _ (fmap f y) (fmap f z)"
17:26 fresheyeball joined
17:27 <kubunto> got it
17:27 sykora joined
17:27 fresheyeball joined
17:27 tom7942 joined
17:28 cpennington joined
17:28 <kubunto> turned the x to (f x)
17:29 <ski> yes
17:29 jgertm joined
17:29 <ski> (the error message indicated this position in the code -- "In the first argument of ‘Operator’, namely ‘x’")
17:30 <kubunto> so fmap transforms a monad to a monad right?
17:30 <jle`> fmap transforms a function into a function
17:30 <Sornaensis> fmap applies a function to the contents of a functor
17:30 <jle`> it turns an (a -> b) into an (f a -> f b), for any Functor f
17:30 Deide joined
17:30 roconnor joined
17:31 <jle`> it doesn't transform any monads. monads exist at the type level, not at the value level
17:31 <kubunto> where would a monad fit into a functor?
17:31 <jle`> monads are types, not values, so fmap can't really transform monads because it's a function that works on values
17:32 xall joined
17:32 <jle`> monads are a subset of functors
17:32 <jle`> some functors are monads, like how some rectangles are squares
17:32 <ski> all monads are functors. some functors are monads, some aren't
17:33 phyrex1an joined
17:34 thatguy joined
17:34 <kubunto> so what is a monad?
17:34 pleax_ joined
17:34 bodisiw joined
17:34 <Sornaensis> @hoogle Monad
17:34 <lambdabot> Prelude class Applicative m => Monad m
17:34 <lambdabot> module Control.Monad
17:34 <lambdabot> Control.Monad class Applicative m => Monad m
17:35 <monochrom> "Maybe" is a monad. "IO" is a monad. etc etc.
17:35 <Sornaensis> kubunto: http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#t:Monad
17:35 <kubunto> Either?
17:35 <Sornaensis> a Monad is a type that instances this class
17:35 <Sornaensis> see the 'minimal complete definition'
17:35 <mauke> a monad is a type constructor m
17:35 <mauke> with some functions
17:35 <Sornaensis> a Monad is an applicative and a functor with a definition for (>>=)
17:35 <ski> kubunto : `Either' is not a monad, but `Either e' is a monad, for any type `e'
17:36 <Sornaensis> :t (>>=)
17:36 <mauke> a monad takes a single type parameter, so Int can't be one (no parameter)
17:36 <lambdabot> Monad m => m a -> (a -> m b) -> m b
17:36 <c_wraith> kubunto, the Monad class abstracts over a particular pattern of composition. don't worry about the details - they actually aren't that important
17:36 <glguy> It's not necessary to be a type constructor to be a monad, 'Either a' is a Monad
17:36 <mauke> Either can't be one because it takes two parameters. but 'Either a' (for every type a) is a monad
17:36 <mauke> hmm. maybe "type constructor" is the wrong word
17:36 Jacoby6000__ joined
17:36 <* mauke> redictionarizes
17:36 <ski> "type constructor" is used in two difference senses
17:37 <* ski> uses the other sense
17:37 <mauke> something of kind * -> * :-)
17:37 <ski> type function is a good term, i think :)
17:37 kthnnlg joined
17:38 Elish joined
17:38 danharaj joined
17:38 <ski> (`ReadS' is a monad, but is not an instance of `Monad')
17:39 <monochrom> In want of an oversimplified coarse dichotomy between kind * and other kinds. But oversimplified coarse dichotomies numb the mind.
17:39 <mauke> "parameterized type"
17:40 <kubunto> how would >>= be used on a maybe?
17:40 <monochrom> Just like the one between "values" and "functions" becomes confusing when higher-order functions appear.
17:40 <monochrom> Just 5 >>= (\x -> Just (x + x))
17:41 <mauke> > Nothing >>= \x -> return (show x)
17:41 <lambdabot> Nothing
17:41 <mauke> > Just [1,2,3] >>= \x -> return (show x)
17:41 <lambdabot> Just "[1,2,3]"
17:42 <ski> kubunto : one could say that a monad is a certain "pattern" that has been cropping up again and again, and once one recognizes the common pattern, one can write a couple of helper functions to avoid large swathes of repetitive boilerplate code (which would be easy to get a detail wrong here and there)
17:42 <ski> kubunto : perhaps "What the hell are Monads?" by Noel Winstanley in 1999 might interest you
17:43 <monochrom> There was an ancient small tribe whose number system was the coarse trichotomy "one, two, many".
17:43 <mauke> the thing about Monad is that the instances all seem wildly different. yet they all support the same basic interface
17:44 <Sornaensis> > let x = Just 1;y = Just 5;z = Just 10 in do { x' <- x; y' <- y; z' <- z; return $ z*y+x }
17:44 <lambdabot> error:
17:44 <lambdabot> • Ambiguous type variable ‘a0’ arising from a use of ‘show_M467484464745...
17:44 <lambdabot> prevents the constraint ‘(Show a0)’ from being solved.
17:44 <monochrom> Very "nice" for students, but very useless.
17:44 <Sornaensis> > let x = Just 1;y = Just 5;z = Just 10 in do { x' <- x; y' <- y; z' <- z; return $ z'*y'+x' }
17:44 <Sornaensis> derp
17:44 <lambdabot> Just 51
17:45 <pikajude> use liftA3 (\ x y z -> z * y + x)
17:45 <kubunto> what is >> used for?
17:45 <pikajude> kubunto: it's like >>=, but the second operand ignores the result of the first one
17:45 <kubunto> ?
17:45 <ski> `(>>)' is a variant of `(>>=)' used when the second action one want to sequence after a first one doesn't need to depend on the computed result from the first
17:45 <ski> @src (>>)
17:45 <lambdabot> m >> k = m >>= \_ -> k
17:46 <pikajude> kubunto: x >> y === x >>= \ _ -> y
17:46 dfeuer joined
17:46 <pikajude> or that
17:46 <kubunto> so it doesnt modify whats inside the monad
17:46 <ski> a monad is not something which is passed around at run-time
17:46 cchalmers joined
17:47 <pikajude> a monad isn't necessarily a container
17:47 snowalpaca joined
17:48 <ski> a monad is a type function, together with a couple of functions for operating on values (often called "actions") of a "monadic type", the functions are required to satisfy a few reasonable laws
17:48 <ski> as pikajude, the result of a monadic action isn't necessarily "inside" it
17:48 <ski> @type getLine
17:48 <lambdabot> IO String
17:49 <ski> is an I/O action. the string that is its result, when executed, is not contained inside it
17:49 <pikajude> @quote /bin/ls
17:49 <lambdabot> shachaf says: getLine :: IO String contains a String in the same way that /bin/ls contains a list of files
17:49 <fresheyeball> I know this already has to exist out there
17:49 Rodya_ joined
17:49 <fresheyeball> newtype F a x = F (a -> x)
17:49 <ski> `getLine' is just a "recipe" for how to obtain a string, by communicating with the operating system (possibly communicating with the external world)
17:49 <fresheyeball> is there a name for `F` that is out there already?
17:49 <ski> fresheyeball : `Reader' ?
17:49 <ski> @src Reader
17:49 <kubunto> so when i type "a <- getline" that would be using monads?
17:49 <lambdabot> type Reader r = ReaderT r Identity
17:49 <lambdabot> --OR
17:49 <lambdabot> data Reader r a = Reader { runReader :: r -> a }
17:50 <fresheyeball> sweet!
17:50 <dolio> fresheyeball: (->)
17:50 <ski> kubunto : the `<-' symbol is part of the `do'-notation syntax, which is implicitly translated to calls to `(>>=)' and `(>>)', so yes
17:50 jle` joined
17:50 jle` joined
17:50 <pikajude> "using monads" is a very vague phrase
17:50 <pikajude> but yes
17:50 <fresheyeball> is there a default implimentation for Reader outside of MTL?
17:51 vektorweg1 joined
17:51 Immune joined
17:52 roconnor joined
17:52 <ski> @undo do {x <- Just 2; y <- Nothing; return (x + y)}
17:52 <lambdabot> Just 2 >>= \ x -> Nothing >>= \ y -> return (x + y)
17:52 <ski> kubunto : that shows how `do'-notation gets translated to calls to `(>>=)' (and `(>>)', though it doesn't occur in this example)
17:52 <ski> @src Maybe (>>=)
17:52 <lambdabot> (Just x) >>= k = k x
17:52 <lambdabot> Nothing >>= _ = Nothing
17:53 <fresheyeball> ski: is Reader a Monoid?
17:53 <ski> `Reader rho' is a *monad* (not a monoid), for any type `rho'
17:54 <ski> .. it would also be possible to make `Reader rho a' a monoid, if `a' is a monoid, for any types `a' and `rho'
17:54 Shatnerz0 joined
17:55 Berra joined
17:56 zcourts joined
17:57 ner0x652 joined
17:57 peterbecich joined
17:58 Nik05 joined
17:58 ninefingers joined
17:59 connrs joined
18:00 peterbecich joined
18:00 mizu_no_oto_work joined
18:02 <c_wraith> the underlying type, without the Reader wrapper, already has that Monoid instance!
18:02 drostie joined
18:03 certainty joined
18:03 zdenal joined
18:04 cyborg-one joined
18:08 Luke joined
18:08 jgertm joined
18:10 HarveyPwca joined
18:10 sobaken joined
18:10 thatrandomguy joined
18:12 fizruk joined
18:13 rando6100 joined
18:13 mjs2600 joined
18:14 cpup joined
18:14 saylu joined
18:18 netheranthem joined
18:18 cpennington joined
18:18 Swizec joined
18:19 mwsb joined
18:21 inad922 joined
18:23 serendependy joined
18:23 e14 joined
18:26 tomphp joined
18:27 chu joined
18:29 Shatnerz joined
18:29 <thatrandomguy> Do I have the right feeling that haskell just doesn't lend itself very well to numerical mathematics? I mean it starts right at n-dimensional fields, I have no way to do functions that work on general n-dimensional fields which I defined since I cannot have generic n-tuples. Then if I want to do stuff like numerical simulation or Control of Differential equations the whole problem is that you have some state and you simulate and see ho
18:29 <thatrandomguy> w the state evolves over time
18:29 mbrane joined
18:30 <thatrandomguy> Am I just to new to haskell to understand how it is done or should I look out for a multi-paradigm language?
18:30 <kuribas> when debugging, what is the difference between evaluating an expression, and :forcing it?
18:31 Philonous joined
18:31 greeny joined
18:31 <kuribas> thatrandomguy: numerical computation is normally don't on vectors.
18:31 <kuribas> thatrandomguy: or matrixes (which usually use vector underneat).
18:31 <kuribas> s/don't/done
18:32 gmalecha joined
18:32 replay joined
18:32 <gmalecha> is it possible to import the name of a type family but not import its equations?
18:32 <ski> @hackage ad
18:32 <lambdabot> http://hackage.haskell.org/package/ad
18:32 <ski> "Forward-, reverse- and mixed- mode automatic differentiation combinators with a common API."
18:32 <Sornaensis> thatrandomguy: yea it sounds like you want vectors, not tuples
18:33 insitu joined
18:33 <thatrandomguy> yeah ok maybe I should look further into it first
18:34 <kuribas> thatrandomguy: you can use immutable state, or use the ST-monad.
18:34 <thatrandomguy> somehow I read the whole tutorial, did all tasks and it was really fun but as soon as I start to think about the stuff I want to do on my own I have a feeling that haskell is not sooo suitable for this as the tutorial tasks where
18:34 mjs2600 joined
18:34 <thatrandomguy> they where nearly exclusively about parsing
18:34 biglama joined
18:34 <Cale> were?
18:35 afarmer joined
18:35 <thatrandomguy> Cale, are you asking which tutorial?
18:35 <Cale> No, you probably meant "they were"
18:35 kakashiAL joined
18:35 tomphp joined
18:35 <thatrandomguy> yes, that is what I meant, thank you
18:35 <kuribas> thatrandomguy: haskell lacks support for numerical programs, compared to Python or Julia...
18:36 <thatrandomguy> ok thanks everyone I will try to do the stuff with the vector package now
18:36 <kuribas> thatrandomguy: but it's not a flaw of the language...
18:36 path[l] joined
18:36 coot joined
18:36 <thatrandomguy> yes pythons numpy is really just the dream of dreams
18:36 contiver joined
18:36 Ch3ck joined
18:36 <kuribas> I'd say haskell is more suited than python.
18:36 <mnoonan> thatrandomguy: you may also be interested in Accelerate, at least down the road: https://hackage.haskell.org/package/accelerate-0.15.1.0/docs/Data-Array-Accelerate.html
18:37 Maxou joined
18:38 <kuribas> My feeling about GPU in haskell is that it rarely is worth it.
18:38 <thatrandomguy> kuribas, I hope so
18:38 vlatkoB_ joined
18:38 <thatrandomguy> I really like haskell and the abstraction it brings
18:38 <thatrandomguy> mnoonan, thanks I'll keep that in mind in case I need it
18:38 <thatrandomguy> thanks everyone for helping
18:39 <Cale> You might find hmatrix helpful
18:39 k0001 joined
18:39 <fresheyeball> I just published a thing http://hackage.haskell.org/package/Empty-0.1.0.0/docs/Control-Empty.html
18:40 <Cale> fresheyeball: "annihilation"
18:41 <thatrandomguy> Cale, that does look like a good companion for vector
18:41 <Cale> thatrandomguy: http://hackage.haskell.org/package/hmatrix-0.18.0.0/docs/Numeric-LinearAlgebra.html
18:41 <fresheyeball> Cale: oops
18:43 groscoe joined
18:43 Rodya_ joined
18:43 Maxou joined
18:44 saylu joined
18:45 Rub_ixCube joined
18:45 <Rub_ixCube> hello
18:45 gcross joined
18:45 SepakoRayl joined
18:45 <Cale> hi
18:45 ub joined
18:46 peterbec` joined
18:46 chenshen joined
18:46 obadz joined
18:47 <fresheyeball> Cale: fixed!
18:48 Boomerang joined
18:48 tomphp joined
18:50 Hello_ joined
18:51 kubunto left
18:51 <Hello_> Does Haskell have the observable pattern built in?
18:51 <Hello_> IE is there is no need for ReactiveX?
18:51 <fresheyeball> Hello_: Haskell has Reactive programming
18:52 <fresheyeball> but Reactive programming is distinct from the Observable pattern
18:52 buglebudabey joined
18:53 <fresheyeball> Hello_: imho ReactiveX is kind of a broken idea
18:54 <SomeT> for a false beginner in haskell, whats the best genetic algorithm library?
18:54 <Hello_> How is it distinct? I'm new to functional programming and have trouble understanding. Doesn't Reactive programming essentially boil down to events being dispatched in an immutable stream and a listener responding to those events, and making changes based purely on the state?
18:55 steeze joined
18:56 <fresheyeball> Hello_: its distinct in a couple ways. So Rx Observable are writable at any time. Reactive streams are immutable, and so all the information needed to create the stream must be local to stream creation. IE no `onNext`.
18:56 tomphp joined
18:56 AndreasK joined
18:56 <fresheyeball> Rx Observables are also samplable at any time. And most Reactive streams are not samplable, IE you can't just get the last value out at any time.
18:57 soulisson joined
18:57 <fresheyeball> I think you have the core idea of Reactive, but its pretty different from what Rx gives you inpractice.
18:58 <kuribas> Hello_: there is reactive-banana
18:58 saylu joined
18:58 <soulisson> Hi, sorry to bother you. I'm trying to learn about functional programming. I'm not familiar with haskell but I would like to understand the concept of Monad. I read several blog posts and I understood a Monad as an object that contains a value and has some methods like bind.
18:58 <fresheyeball> Rx also has this idea of a hot and cold stream, this is mutation built into the core abstraction of an Observable. Haskell does not allow this.
18:59 <kuribas> soulisson: Monad is not an object, it's apattern.
18:59 mbrane joined
18:59 <kuribas> soulisson: It's basicly a typeclass, with some laws (which aren't enforced).
18:59 <fresheyeball> soulisson: Monad is a type for which you can write two functions, that obey the Monad laws
19:00 <fresheyeball> Hello_: so reactive streams cannot be active or inactive, they just are.
19:01 hazmat_ joined
19:01 <fresheyeball> soulisson: I would start by understanding Functor before learning about Monad
19:01 nadirs joined
19:01 <soulisson> fresheyeball: ok
19:01 inad922 joined
19:02 <kuribas> soulisson: for example, r -> a is a monad, but it doesn't "contain" an "a".
19:02 <Hello_> fresheyball: I see.
19:02 <kuribas> soulisson: it's purely a type level thing.
19:03 wraithm joined
19:03 <kuribas> (well, except for the laws)
19:03 <fresheyeball> soulisson: yeah kuribas is right. Many people trip on this. Monads are not necissarily containers, though many containers are Monads.
19:03 <fresheyeball> soulisson: Monad is just more abstract then your intuition tells you at first.
19:04 <soulisson> fresheyeball: the notion of type is close to the notion of class in OOP?
19:05 <fresheyeball> soulisson: no
19:05 <kuribas> soulisson: no
19:06 <kuribas> soulisson: you shouldn't try to understand monads before you know what typeclasses are.
19:06 <fresheyeball> soulisson: there are Monads in OOP, but you would never know it, because the asbraction of Monad is impossible to express in OOP. You can think of Monad more like its an interface.
19:06 <kuribas> soulisson: it will just confuse you.
19:06 oleksiyp joined
19:06 <fresheyeball> soulisson: type classes are like way more flexible interfaces in OOP
19:07 <soulisson> Ok, I'll try. seems a little complex for now. Thanks for your help
19:08 jomg joined
19:08 paolino joined
19:08 insitu joined
19:08 <fresheyeball> soulisson: keep on learning!
19:09 pleax joined
19:09 path[l] joined
19:09 <shapr> soulisson: I like haskellbook.com, it builds up from functor to applicative to monad
19:10 <soulisson> I'll check it
19:12 epsilonhalbe joined
19:12 groscoe joined
19:13 msko joined
19:13 Apocalisp joined
19:14 madbot joined
19:14 <shapr> soulisson: have you written any Haskell code?
19:15 twanvl joined
19:15 <soulisson> shapr: No, I'm learning FP without any specific language, just the theory for now
19:15 <shapr> soulisson: found anything especially interesting?
19:15 BlueRavenGT joined
19:15 <fresheyeball> soulisson: I highly recommend learning Haskell to accomplish that
19:15 gimps1 joined
19:17 <soulisson> shapr: liked memoization, currying, higher order functions and clojures but Monads are challenging to understand for now
19:17 eschnett joined
19:17 <shapr> soulisson: the best hand wavey explanation I've seen is "decorating function composition"
19:18 <Zemyla> Question. Is the specific type of garbage collector part of the RTS chosen, or is it baked deeper into GHC?
19:18 falafel joined
19:18 <shapr> I think generational garbage collection is baked into GHC, but you can tune the settings.
19:18 uglyfigurine joined
19:18 mkoenig joined
19:18 <soulisson> shapr: I kind of understand the bind function and its usefulness but other than that ...
19:19 pi___ joined
19:19 <sternmull> i would say playing around in haskell with a few basic monads is very helpful to understand their nature. Most of the stuff i read about monads is harder to understand than when you see how it fits together in practice.
19:19 <pi___> Hello, When I try to compile Cabal I get this error:
19:19 <pi___> gcc: error: dist/build/Distribution/PackageDescription/Parse.dyn_o: No such file or directory
19:19 <pi___> `gcc' failed in phase `Linker'. (Exit code: 1)
19:20 <shapr> soulisson: how would you describe the usefulness of the bind function?
19:21 Luke joined
19:21 <soulisson> shapr: I seep it like a pipe between the output a function and the input of another function. I mainly saw it when it comes to handling errors
19:21 ramzifu joined
19:23 Maxou joined
19:24 <pi___> Hello, When I try to compile Cabal I get this error:
19:24 <pi___> gcc: error: dist/build/Distribution/PackageDescription/Parse.dyn_o: No such file or directory
19:25 <pi___> `gcc' failed in phase `Linker'. (Exit code: 1)
19:26 <* ski> thinks "r -> a is a monad" is vague enough to probably not be that helpful, except to the cognoscenti
19:29 <pi___> hello
19:30 asthasr joined
19:30 wraithm joined
19:31 <SomeT> Why can't I install these? I really need to install these: https://hastebin.com/wopipabegi.txt
19:31 saylu joined
19:31 fnurglewitz joined
19:31 JuanDaugherty joined
19:32 wraithm joined
19:33 <suppi> SomeT: which ghc version are you using?
19:34 <SomeT> the latest
19:34 <SomeT> but when I used the older versions
19:34 <SomeT> moo package failed to even pick up
19:34 <SomeT> can't win lol
19:34 <suppi> that package was last updated before Applicative became a superclass of Monad
19:34 path[l] joined
19:35 <SomeT> do I need to edit anything in config file for cabal?
19:35 <monochrom> Modify monad-mersenne-random source code, or use an older GHC.
19:36 <SomeT> when I used an oldere ghc then it would not find moo
19:37 <suppi> what do you mean?
19:37 <kuribas> why does the ghci debugger, when I force an expression, still evaluates the subexpression?
19:38 <monochrom> Yeah, I don't understand "not find" either. What is the exact error message?
19:39 <kuribas> (after :step)
19:39 insitu joined
19:39 contiver_ joined
19:39 binaryplease joined
19:39 <SomeT> I think I will uninstall everything lol
19:39 <SomeT> I think I messed up my installation
19:40 fosskers joined
19:40 <SomeT> http://support.hfm.io/1.3/HaskellCLI-7.10.3-5.18-2.html
19:40 <SomeT> I used them
19:40 <suppi> did you use cabal without sandboxes?
19:40 <SomeT> and now I can't figure out how to fully remove
19:40 <SomeT> yes without sandbox
19:41 <suppi> sorry i must go, i'll be back later
19:42 <SomeT> ok
19:42 <kuribas> how annoying...
19:42 albertus1 joined
19:43 <kuribas> Either ghci is retarded, or I am missing something...
19:43 cdg joined
19:45 msko joined
19:45 <kuribas> I don't want it to descent into the expression...
19:46 AALLEE joined
19:46 <shapr> gutentag AALLEE, wie geht es?
19:46 srbaker_ joined
19:46 lukaramu joined
19:47 <kuribas> please tell me, how do I keep ghci from descending into the expression?
19:47 <davean> kuribas: what are you talking about?
19:47 <kuribas> davean: the ghci debugger
19:48 <kuribas> davean: I force _result, but it keeps descending into the expression...
19:48 <davean> kuribas: you want to not have it show the evaluation?
19:48 <kuribas> davean: no
19:48 bjz joined
19:48 <davean> kuribas: tracing the evaluation is exactly the thing it does
19:49 <kuribas> davean: why would I care about the whole evaluation?
19:49 <kuribas> davean: I forced _result for a reason...
19:49 <davean> If you don't, why are you using the debugger?
19:49 <kuribas> davean: so it can show me the relevant parts...
19:50 <SomeT> ok I wiped haskell from my system
19:50 <kuribas> davean: it's the _result from a subexpression.
19:50 <kuribas> davean: which I don't particularly care about.
19:50 <SomeT> on a mac using the software 'haskell for mac' in terms of installing moo shall I install these: http://support.hfm.io/1.3/HaskellCLI-7.10.3-5.18-2.html or shall I install haskell via brew or both?
19:51 <kuribas> davean: I just want to skip it.
19:54 <AWizzArd> Is it possible to force ghc to output a binary, even in the presence of type errors
19:55 <Sornaensis> yea you can use unsafeCoerce I guess
19:55 <ski> AWizzArd : `-fdefer-type-errors' ?
19:56 <AWizzArd> ski: thx
19:56 <Sornaensis> ski: how does that work
19:56 <Sornaensis> type errors at runtime?
19:56 <ski> yes
19:57 sarkin joined
19:58 zcourts joined
19:59 groscoe joined
20:00 caumeslasal joined
20:04 JonReed joined
20:04 thatrandomguy joined
20:07 AALLEE left
20:07 meoblast001 joined
20:09 insitu joined
20:09 connrs joined
20:11 lilred joined
20:12 nomotif joined
20:13 path[l] joined
20:14 thatguy joined
20:14 <thatguy> what do I need to install to use https://hackage.haskell.org/package/hmatrix-0.18.0.0/docs/Numeric-LinearAlgebra-Data.html ?
20:14 Destol joined
20:14 <thatguy> nvm
20:15 <suppi> SomeT: best idea i have is to install ghc and cabal binaries and learn how to use them and cabal sandboxes
20:15 <suppi> i'm not sure which version will work with the package you want
20:15 <suppi> maybe search by date
20:16 mhagemeister joined
20:17 <suppi> a maybe better way to solve your problem is to modify the source of the package that gives you trouble
20:18 haennar joined
20:18 crobbins joined
20:18 lspitzner joined
20:19 groscoe joined
20:19 <suppi> this might help for cabal sandboxes: http://katychuang.com/cabal-guide/
20:19 abhiroop joined
20:22 <abhiroop> Can someone explain what the ⇓ symbol means in PL theory
20:22 fendor joined
20:23 <Cale> abhiroop: Perhaps "reduces to"? It's hard to say for certain without more context.
20:24 louispan joined
20:24 <abhiroop> As an example I can provide this ⟨BC, σ0⟩ ⇓ ⟨B · BC, σn⟩ but then I would have to explain all the other variables
20:24 <thatguy> if I don't want to lazily return x + s*x' but want the function to actually compute it, how do I do that?
20:24 <lyxia> abhiroop: that looks like a reduction relation
20:24 <abhiroop> I thought this has a uniform meaning eg : Γ means an environment in any context
20:25 <johnw> thatguy: return $! x + s*x
20:26 <dolio> What if Γ means the gamma function?
20:26 <thatguy> so fun x x' s = ! x + s*x' ? johnw
20:26 <johnw> oh, you didn't mean do-notation return
20:26 <suppi> abhiroop: i think 'evaluates to' or 'reduce to' as cale said
20:26 <johnw> there's no way for your function to force its own evaluation, that's the caller's job; it can only force the arguments it must evaluate _when it is evaluated_
20:27 raichoo joined
20:27 <thatguy> ah how would I force it as the caller?
20:27 <johnw> one way: let !x = myfun blah blah in use x...
20:28 <johnw> but still, this only happens when the result of *that* expression is needed
20:28 <thatguy> is that considered good practice or should I try to let the stuff evaluated when it is passed as argument?
20:28 buglebudabey joined
20:28 <johnw> in general I'd say don't worry about strictness until you need to
20:29 <thatguy> I am calculating someting which will have the form of x + s*x' + s*x'' + s*x''' + .... and don't want to carry that around with me
20:29 <thatguy> in case it gets long
20:29 Maxou joined
20:29 <thatguy> all the xs will also be vectors which scales the whole thing again in memory
20:31 <thatguy> johnw, ok thanks then maybe I'll try without strictness for now
20:31 <thatguy> but I have the feeling it would be appropriate here
20:31 <johnw> I'm not sure if this is the right answer for your situation, but if you want to write pure code that forces results everywhere possible, you might consider: https://hackage.haskell.org/package/strict-identity-0.1.0.0/docs/Control-Monad-StrictIdentity.html
20:33 drostie joined
20:33 <thatguy> johnw, I will have a look, thank you
20:33 doomlord joined
20:33 <johnw> my spidey sense tells me this isn't the right answer, though
20:33 <johnw> so come back if the lazy approach fails
20:35 <thatguy> :D I'll trust in your spidey sense that
20:35 <thatguy> *then
20:35 <ski> abhiroop : presumably a big-step operational semantics
20:35 contiver__ joined
20:35 CurryWurst joined
20:36 <abhiroop> Thanks ski and others
20:37 <abhiroop> This actually is big step operational semantics
20:37 connrs joined
20:37 <abhiroop> Corresponding small step operational semantic would e1 --> e1' --> e2
20:37 <abhiroop> So I guess it translates to "reduces to"
20:38 contiver_ joined
20:39 <ski> "finally reduces to"
20:39 Luke joined
20:40 insitu joined
20:40 crobbins_ joined
20:41 jgertm joined
20:41 kadoban joined
20:42 indi_ joined
20:49 Guest68756 joined
20:50 sellout- joined
20:50 OscarZ joined
20:50 bodisiw joined
20:50 OscarZ_ joined
20:50 slaterr joined
20:52 <codedmart> Did something change in aeson with parsing integers and floats? I upgrading and now I am seeing an error `Floating number specified for Integer`
20:53 noam joined
20:53 hrumph joined
20:55 HanlonsRazor joined
20:56 Jackneill_ joined
20:56 _sg joined
20:57 bobakk3r joined
20:57 <umib0zu> Hey Haskell. I had a question about Least Fixed Point Semantics here if anyone is interested. https://www.reddit.com/r/AskComputerScience/comments/5x5mkb/why_is_least_fixed_point_semantics_for_recursion/
20:58 binaryplease joined
20:59 bobakk3r left
20:59 Jackneill_ joined
21:00 binaryplease1 joined
21:02 marfoldi joined
21:03 sobaken joined
21:05 marfoldi joined
21:07 bjz joined
21:08 <thatguy> can anyone tell me why 3.0*vector [1,2] works but let a = 3 :: Double, a * vector [1,2] gives me "couldn't match types?"
21:09 <ski> presumably in the former case `3.0' is a vector ?
21:09 <thatguy> ski, can I somehow check which type it has in the former case?
21:10 <ski> doesn't "couldn't match types?" tell you the involved types ?
21:11 <ski> if it's the ordinary `(*)', then it should be the same type as the type of `3.0*vector [1,2]'
21:11 <thatguy> ski, it only tells me in the case it does not work
21:12 <thatguy> 3.0 * vector [1,2] does what I thought it would: [3.0, 6.0]
21:12 <thatguy> the other one gives me the type missmatch
21:12 <ski> between which two types ?
21:12 <thatguy> Couldn't match expected type ‘Double’ with actual type ‘Vector ℝ’
21:12 <thatguy> where type R = Double
21:13 <thatguy> I'm actually pretty impressed that the library used this fancy R for the real numbers
21:13 Luke joined
21:14 <Tuplanolla> I'm annoyed by it, because it's actually `Double`.
21:14 <ski> ok, so the type of `3.0' there is `Vector Double'
21:14 Nicnux joined
21:15 <thatguy> so to do scalar multiplication I have to convert my Double to a vector Double and then multiply them?
21:15 <thatguy> is that the good practice way or would it be more haskelly to use the Vector.map function?
21:17 <thatguy> Tuplanolla, but still I have to admit no other console application spitted me out such fancy mathbb letters until now
21:17 <Tuplanolla> You need APL in your life.
21:18 fDev2179 joined
21:18 <thatguy> Tuplanolla, what is that?
21:18 Rodya_ joined
21:19 LuckyRawApe joined
21:19 <shapr> A Programming Language
21:19 <Tuplanolla> @google apl, a programming language
21:19 <lambdabot> https://en.wikipedia.org/wiki/APL_(programming_language)
21:19 <* ski> smiles
21:19 <Rembane> J!
21:19 <shapr> https://en.wikipedia.org/wiki/APL_(programming_language)
21:19 <shapr> Tuplanolla: beat me to it
21:19 TxmszLou joined
21:19 grayjoc joined
21:20 roconnor joined
21:20 <shapr> I never did track down an IBM Selectric typewriter APL font golf ball.
21:20 <kuribas> The ghci debugger is broken...
21:23 <shapr> kuribas: fix it?
21:23 <kuribas> shapr: I am not a ghc expert...
21:23 <thatguy> :D "A Programming Language" that is a hint what to search for on the one hand and a complete solution on the other hand
21:23 <thatguy> Tuplanolla, from wikipedias first sentence "It uses a large range of special graphic symbols[11] to represent most functions and operators" you are right, it seems I would enjoy it
21:23 <thatguy> short at least
21:23 <thatguy> so can anyone tell me if there is any difference between using the Vector.map function or converting the scalar to a Vector before multiplying?
21:25 <kuribas> thatguy: Vector.map is probably more efficient.
21:25 <kuribas> As you don't create another vector.
21:25 <Tuplanolla> I wonder if there's a rewrite rule for this.
21:25 buglebudabey joined
21:26 <Tuplanolla> That would not be surprising.
21:26 <thatguy> hmm I just saw that I was confusing the libraries. Vector.map is from the Vector library, I am now using the hmatrix library
21:26 zcourts joined
21:26 contiver__ joined
21:27 ramzifu joined
21:27 <thatguy> but then I'll use fmap
21:27 <thatguy> Thanks everyone for helping, I'm gone for today, have a nice evening/day
21:27 peterbecich joined
21:28 plertrood joined
21:30 <Nolrai> Okay so is there a way to have the type wittness what exceptions are thrown by a pure function?
21:31 insitu joined
21:31 epsilonhalbe left
21:31 <Nolrai> Even if I am not planing on catching the exception?
21:31 <davean> Nolrai: no
21:31 <Nolrai> Okay.
21:31 <Nolrai> Thanks!
21:31 lspitzner joined
21:32 <davean> Nolrai: so, its not even generally theoretically possible
21:32 <davean> Nolrai: if you think about it, whats the set of exceptions that might be thrown?
21:32 <Nolrai> Right.
21:32 <Tuplanolla> @hackage directory
21:32 <lambdabot> http://hackage.haskell.org/package/directory
21:32 <Tuplanolla> Exceptions are usually documented like this.
21:32 <davean> Nolrai: for example bottoms
21:32 <davean> we get into a computability issue
21:33 <monochrom> I don't think we include bottom as an exception.
21:33 <davean> monochrom: some throw exceptions
21:33 sjakobi joined
21:34 crobbins_ joined
21:35 <Nolrai> Stack overflows, and blackholes for example.
21:35 srbaker_ joined
21:36 binaryplease joined
21:36 jacqueline[m] joined
21:37 coeus_ joined
21:39 JoshS joined
21:39 <Nolrai> Hmm. What I should probably really do is explicitly build a error hierarchy and use the Except monad. I wish the type checker could build the sum type for me. That is probably silly of me.
21:39 <davean> Nolrai: that already exists
21:39 <Nolrai> It does?
21:39 <davean> Nolrai: https://hackage.haskell.org/package/control-monad-exception
21:40 <monochrom> It is a simplifying and coarse denotational semantics to lump non-termination and head [] (for example) together as "the same" bottom. It makes the math more beautiful. It doesn't mean that we always have to limit ourselves that way. head [] takes very much finite running time to detect.
21:40 cdg joined
21:41 <davean> monochrom: I never said it was the same ones
21:41 Koterpillar joined
21:41 <davean> I said you couldn't type all potential exceptions in Haskell's type system
21:41 <Tuplanolla> I can't imagine a better way to go insane.
21:42 <jacqueline[m]> So...what is "sane" anyway?
21:42 <jacqueline[m]> That's just a matter of semantics :D
21:42 <monochrom> But you used the wrong reason, or I misread your reason.
21:42 dbmikus joined
21:43 <davean> monochrom: I said there was a computability issue
21:43 <davean> I never said anything about partial functions in any way shape or form
21:43 <monochrom> Then I read correctly. That's the wrong reason.
21:43 <davean> monochrom: no?
21:44 <monochrom> Because running into head [] is not a computability issue.
21:44 <davean> monochrom: Haskell's type system is litterly insufficient to type the exceptions a pure function can throw
21:44 <davean> monochrom: I never said it was
21:44 <davean> monochrom: I said noything about "head []" in any way
21:44 <davean> monochrom: I didn't say there were no exceptions it couldn't type
21:44 <davean> I said there were ones it couldn't
21:44 <davean> My proof was an existance proof, not a completeness proof
21:45 <monochrom> OK, we don't usually include non-termination and similarly uncomputable conditions as exceptions. OK, let's just say I don't.
21:46 <davean> monochrom: it throws a Haskell exception in many cases
21:46 <Tuplanolla> @hoogle NonTermination
21:46 <monochrom> When I hear "exception" I only think of head [] and division by zero and a few more similar things, things that are finite-running-time detectable at the very least.
21:46 <lambdabot> Control.Exception data NonTermination
21:46 <lambdabot> Control.Exception NonTermination :: NonTermination
21:46 <lambdabot> Control.Exception.Base data NonTermination
21:47 <davean> monochrom: and yet, thats not Haskell's explicite notion of exception at all
21:47 ertes joined
21:47 <davean> monochrom: So, all I can say is your definition seems entirely irrelivent in a discussion about Haskell?
21:48 <davean> I mean we could have other definitions
21:49 greeny joined
22:25 irclogger_com joined
22:25 Topic for
22:25 louispan joined
22:25 <ski> for any type `a', `Nothing' has type `Maybe a'
22:25 <ski> for any type `a', if `x' has type `a', then `Just x' has type `Maybe a'
22:26 <ski> this is what
22:26 <ski> @src Maybe
22:26 groscoe joined
22:26 <lambdabot> data Maybe a = Nothing | Just a
22:26 <ski> means
22:26 refold joined
22:26 anhduy joined
22:26 <ski> (which is what the definition of `Maybe' looks like)
22:28 BlueRavenGT joined
22:28 <nbro> well, from what I understood Nothing and Just a are data constructors, right?
22:28 allenj12 joined
22:28 <ski> `Nothing' and `Just' are data constructors, yes
22:29 DanDevX joined
22:30 <nbro> so
22:30 <nbro> Just True would be of type Maybe Bool..
22:30 zymurgy joined
22:30 <Nolrai> Yes.
22:31 <ski> also `Just (not True)'
22:31 hiratara joined
22:33 <ertes> nbro: data Maybe a = Nothing | Just a -- alternatively you can say that every value of type (Maybe a) is either of the shape Nothing or of the shape (Just x), where 'x' is of type 'a'
22:34 <ertes> data Bool = False | True -- just like every value of type Bool is either of the shape False or of the shape True
22:36 anhduy joined
22:38 <nbro> but Nothing has type Maybe a only not to break the type system, let’s say, right?
22:39 <ertes> nbro: what do you mean?
22:39 troydm joined
22:40 <ertes> Nothing is a legal value of type (Maybe a) for any 'a'
22:41 <monochrom> (What is there to break?)
22:41 <mniip> you're saying "only not to break the type system" as if it were some kind of workaround
22:41 JeanCarloMachado joined
22:41 <mniip> however that's just how ADTs work
22:41 <nbro> well, this nothing can somehow be compared with the nils, nones, and nulls of other programming languages, but in those programming languages, for example in Python, None is of type NoneType, but in Haskell the trick to indicate that something could be or contain indeed nothing is by “wrapping” our types in this Maybe a
22:41 <mniip> it's a feature and whatnot
22:42 <mniip> nbro, python is irrelevant because types are properties of values there
22:42 ppppp5 joined
22:43 <mniip> (like basically any other dynamically typed langauge)
22:43 <monochrom> I don't really understand that sentence. But Python has subtyping and Haskell doesn't. Therefore Python's none story can be different from Haskell's Nothing story.
22:43 <mniip> hmm, subtyping, that's a nice way too look at it
22:43 <monochrom> And neither approach is to prevent "breaking", whatever that means.
22:44 <nbro> I’m just comparing the conceptual way of representing nothing in different languages…
22:44 <mniip> nbro, haskell, for example, has a truly empty type
22:44 <mniip> a type of which no value exists
22:44 <nbro> in order to understand better the one in Haskell
22:44 <mniip> any computation that has a result of that type must either error or not terminate
22:44 Voldenet joined
22:44 Voldenet joined
22:45 <monochrom> Or alternatively but equivalently, every language design is to prevent "breaking" something, so you could tautologically say that everything done in Haskell is to prevent breaking the Haskell way, everything done in Python is to prevent breaking the Python way, etc etc, which sounds really nice but is informationless.
22:45 <c_wraith> nbro, the thing about Haskell is that Nothing isn't a special value and Maybe isn't a special type. they're completely normal things defined in pure haskell in the standard library.
22:45 dsh joined
22:45 <monochrom> To sum up, Python goes subtype polymorphism, Haskell goes parametric polymorphism. And there is a sense in which they are opposites.
22:46 <nbro> monochrom: if this Maybe a wouldn’t have been invited, how could you represent the absence of something in Haskell?
22:46 contiver__ joined
22:46 <ski> nbro : conceptually, `Maybe T' "adds a new value to `T'". this means that `Maybe (Maybe T)' will now how two values in addition to the ones of form `Just (Just x)', with `x' of type `T'. this is unlike the story with nulls
22:46 <nbro> *invented
22:46 <mniip> nbro, invent your own?
22:46 <monochrom> It can always be invented and reinvented.
22:46 <c_wraith> nbro, you'd create a type just like it. there's nothing special about it. no magic.
22:46 <monochrom> In fact I know that the GHC API reinvented it once.
22:46 <nbro> @monochrom I mean, the concept
22:46 <lambdabot> Unknown command, try @list
22:46 <mniip> @let data Maybe' a = Nothing' | Just' a
22:46 <lambdabot> Defined.
22:46 <monochrom> And some http library revinvented it too.
22:47 <nbro> suppose for a moment that nobody managed to invent such a thing
22:47 <monochrom> Yes, the concept. It can always be reinvented.
22:47 BlueRavenGT joined
22:47 <mniip> > Just' 3
22:47 <c_wraith> nbro, it's basically impossible to not invent when you have algebraic data types.
22:47 <lambdabot> Just' 3
22:47 <mniip> > Nothing'
22:47 <lambdabot> Nothing'
22:47 <monochrom> OK, suppose that. Then we can prove true = false too. Yes, it's a vacuous premise.
22:48 <monochrom> Alternatively, why don't you suppose python did not have class and/or objects?
22:48 doodlehaus joined
22:48 <mniip> nbro, well, suppose we want to represent absence of something in haskell
22:49 <mniip> e.g we want a type that is either an int or nothing
22:49 <mniip> data FancyInt = AnInt Int | NoInt
22:49 <mniip> but wait we want it for more types than just Int
22:49 <mniip> why not make it parametric
22:49 msko joined
22:49 <mniip> data FancyThing a = AThing a | NoThing
22:49 <mniip> oops invented maybe
22:50 <monochrom> In Python you can use "none" wherever a list is expected, or a set is expected, or a date is expected, etc etc. This is why I mentioned subtyping. "none" is of NoneType but the thing is NoneType is a subtype of essentially all other types.
22:50 <monochrom> But Haskell doesn't do that. Haskell does the opposite.
22:50 louispan joined
22:51 <mniip> monochrom, huh?
22:51 <monochrom> In Haskell you can't use "Nothing" wherever a list is expected, or a set is expected, or a date expected. You can only use it where a "Maybe XXX" is expected.
22:51 <nbro> @mniip maybe I shouldn’t have said “not to break the type system”, which seems like one’s blaspheming for a religious person
22:51 <lambdabot> Unknown command, try @list
22:51 mbw joined
22:51 <mniip> monochrom, fairly sure you can't use None everywhere in python
22:52 <mniip> however you might have a different idea of what 'types' really mean in python
22:52 <mniip> def foo(x): return x[1]
22:52 <mniip> does that function take None? I don't think so
22:52 soLucien joined
22:52 <mbw> What are the modules Data.Array.IO.Safe and the other "Safe" ones for? I can't see any differences...
22:52 GlobalAtom joined
22:52 <mbw> Between those and the parent modules, that is
22:52 <monochrom> OK, I was wrong, but I think it can be saved. Can that function return None?
22:53 <mniip> sure
22:53 <mniip> it returns exists a. a
22:53 <monochrom> OK, so s/use/return/ and I think I'm good.
22:53 <Tuplanolla> It seems to have no problems taking `None` for me, mniip.
22:54 <mniip> but NoneType has no __getitem__
22:54 magnusgbr joined
22:54 <Tuplanolla> For sure, but that happens after you have given the procedure your `None`.
22:55 <Ch3ck> What is a blackhole, as it relates to haskell or programming?
22:55 <mniip> nbro, not really, we are not closed-minded, it's just that your proposition is actually of little logical sense
22:55 <Tuplanolla> Perhaps I don't know what to expect here.
22:55 <nbro> and maybe Python wasn’t the best example to compare things with Haskell, lol
22:55 <mniip> Tuplanolla, then all functions are universal in python
22:55 <mniip> just some are partial
22:55 <Tuplanolla> ...yes?
22:55 <mniip> that's a useless representation
22:56 <mniip> monochrom hinted at subtyping as a useful representation of typing rules in python
22:56 <nbro> @mniip ok, no problem, give me one month and you will see another master in haskell :D lol
22:56 <lambdabot> Unknown command, try @list
22:56 <mniip> month huh
22:56 <mbw> Does anybody know what the "Safe" variants of the Data.Array headers are for? Does it have to do with safe haskell?
22:56 <lyxia> mbw: note the Safe Haskell field in the header.
22:56 connrs joined
22:56 <monochrom> I am not religious. This is why I questioned "what is there to break?"
22:56 <mniip> I've been here for 3 years and I wouldn't call myself "master" by any chance
22:57 <mbw> lyxia: Ok, that confirms my suspicion. But in what way do these modules differ? Is the API more stable?
22:57 e14 joined
22:57 <geppettodivacin> Ch3ck: Pretty sure that it usually refers to a function that can never return, but isn't detectable as a loop.
22:58 <mniip> no
22:58 <monochrom> isn't? is?
22:58 <mniip> Ch3ck, a blackhole is a thunk that is currently being evaluated by ghc
22:59 <mniip> it is distinctly highlighted for a number of reasons
22:59 <monochrom> Because if the computer bothers to print a "black hole" message, certainly something has been detected.
23:00 <mniip> if one thread wants to evaluate a thunk and it's a blackhole, it knows another thread is evaluating it, and it can subscribe to the blackhole to let the evaluating thread wake it up once the computation is done
23:00 <lyxia> mbw: I don't know, sorry.
23:00 <mniip> and if a thread evaluates a blackhole that it is itself evaluating, it'll know that it's stuck in a loop
23:00 chu joined
23:00 <mniip> or something like that
23:01 <nbro> @mniip by master I mean to master the concepts behind the programming language, not all features or libraries, etc ;)
23:01 <lambdabot> Unknown command, try @list
23:01 <mniip> would you like to know more? read the ghc commentary and/or the stg paper
23:01 BlueRavenGT joined
23:01 <mniip> nbro, you underestimate its power
23:01 <nbro> @mniip maybe yes :D
23:01 <lambdabot> Unknown command, try @list
23:02 <geppettodivacin> Ah, I too have learned something. Neat.
23:03 <mbw> lyxia: No sweat. At least I know what to look up next. I have time...
23:03 ch3ck joined
23:04 <ertes> nbro: don't think of Maybe or Nothing as something special
23:04 pera_ joined
23:04 <ertes> Maybe does not have any special status… in fact it's defined in a library
23:04 <ertes> however, haskell itself is special to a certain degree in that it does not have an observable "null"
23:05 <mniip> base is a special enough library so that's a poor argument :p
23:05 <ertes> base certainly is, but Maybe isn't =)
23:05 <Koterpillar> ertes: that is not special; null is special
23:05 pleax joined
23:05 pasukon joined
23:06 <ertes> Koterpillar: in the sense that a lot of languages have that special value… haskell is more natural, yes, but it's certainly the special one among most other languages
23:06 <ertes> in that those other languages are unnatural
23:06 <monochrom> "special relativity"
23:06 <nbro> ahah
23:06 <* ski> . o O ( "Null References: The Billion Dollar Mistake" by Tony Hoare in 2009-08-25 at <https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare> )
23:07 <nbro> nice conversations here
23:07 <mniip> terminologicaly SR is a special case of GR so all is well
23:07 <monochrom> yeah just punning
23:09 <mbw> Ok, I just read about safe haskell: https://wiki.haskell.org/Safe_Haskell. Quote: "For typical Haskell programmers, using {-# LANGUAGE Safe #-} will be like -Wall: something that is considered good practice from a hygiene point of view." Is there general consensus on this, or is it not widely used after all?
23:10 louispan joined
23:10 <mbw> Btw the billion dollar mistake was not a null pointer dereference, but something like a comma instead of a colon in a FORTRAN format string, if I remember correctly.
23:11 <ertes> in that sense the billion dollar mistake was FORTRAN
23:12 <mbw> That's probably the gist of Backus' Turing award speech :)
23:13 <ertes> i also liked peter sewell's examination: https://media.ccc.de/v/31c3_-_6574_-_en_-_saal_1_-_201412301245_-_why_are_computers_so_and_what_can_we_do_about_it_-_peter_sewell
23:13 xpika joined
23:15 <monochrom> Wait, so Backus invented functional programming for avoiding comma and colon typos?!
23:15 aaron7 joined
23:16 <mbw> Even if so, he didn't succeed. Fortran is still around.
23:16 <Nolrai> Ch3ck : It's a way for the compiler to catch some infinite loops, basically.
23:16 puregreen joined
23:16 gillesmajor joined
23:17 <geekosaur> comma instead of period is actually an urban legend, iirc. but mostly that one is just lexing; pre-fortran90 considered DO 10 I = 1. 10 (typo period for comma in a loop starter) and DO10I = 1.10 (assignment) the same...
23:17 gillesmajor left
23:18 <Ch3ck> Nolrai, this is the first time I'm hearing of the concept. It is unique to haskell?
23:18 msko left
23:18 <mbw> Good old "IMPLICIT DOUBLE PRECISION (A-H,O-Z)"
23:18 <nbro> thanks for your help! I will probably come back ;)
23:18 nbro left
23:20 <mbw> If you think about it, python has this...
23:21 <mniip> Nolrai, uhh
23:21 <mniip> that's somewhat misleading too
23:22 <mniip> its primary purpose is multithreading
23:22 <monochrom> detecting a special kind of nontermination is a side effect
23:22 refold joined
23:22 Rainb joined
23:23 <Nolrai> <mniip> : Ah, I did not know that.
23:23 <Nolrai> Hmm. I wonder what I read that led me astray.
23:25 tromp joined
23:25 otulp joined
23:25 <monochrom> It doesn't take a lot of reading. It is an easy guess from personal experience. The thing is that it is non-obvious why the runtime system even bothers.
23:30 kritzcreek_ joined
23:31 doodlehaus joined
23:32 uglyfigurine joined
23:33 <Ch3ck> So is it unique to haskell?
23:33 <Ch3ck> I'm a FP and Haskell newbie :-)
23:34 ub joined
23:34 <monochrom> Oh yikes haha "The obsolete language options -XPolymorphicComponents and -XRank2Types are synonyms for -XRankNTypes" (GHC 8.0.2 or maybe earlier)
23:35 Zemyla joined
23:35 Edith joined
23:35 <glguy> That happened before GHC 8, I don't remember when in the 7 series it was, though
23:35 contiver__ joined
23:37 ericsagnes joined
23:37 mbrane joined
23:37 <ertes> yeah, Rank2Types was obsoleted a long time ago
23:38 <monochrom> Ah OK.
23:38 <monochrom> I agree that if you use PolymorphicComponents then you're very likely to also use RankNTypes.
23:38 <ertes> IMO it was a pointless extension anyway, because you could always just use a rank-2 subset of RankNTypes
23:39 vtomole joined
23:39 <monochrom> The lack of a significant second compiler that makes a difference.
23:39 <mniip> Ch3ck, it's unique to STG
23:40 umib0zu joined
23:40 <mniip> the graph reduction machine implementation as it appears in GHC
23:40 eacameron joined
23:40 <mniip> once again, read up on ghc commentary and/or the stg paper
23:40 <Ch3ck> mniip, what's STG?
23:41 <Ch3ck> Ahh I see
23:41 <monochrom> Because IIRC there is still a theoretical difference between rank-2 and rank-all-in, and it could cause a difference in how-hard-to-implement too.
23:41 <geppettodivacin> So not only Haskell specific, but GHC specific.
23:41 afarmer joined
23:41 <mniip> monochrom, there's a terminating rank2 checker
23:41 <vtomole> Any other "fleshed out" haskell implementations other than ghc?
23:41 <mniip> not a rank3 however
23:42 <ertes> Ch3ck: in fact it's specific to the GHC *compiler*
23:42 <ertes> > let x = x in x
23:42 <lambdabot> mueval-core: Time limit exceeded
23:43 <ertes> a compiled program would have thrown an exception your way
23:43 <* ski> . o O ( the Glasgow Haskell Compiler compiler )
23:43 <Ptival> is there a good reason why Tasty Assertions can't be written agnostically w.r.t. what type of check is to be performed?
23:43 roconnor joined
23:43 <davean> vtomole: there have been a few
23:43 <kuribas> If I force an expression in the ghci debugger, then after :step, it's again unevaluated, it's a bug right?
23:44 <davean> vtomole: GHC is the one that has the energy to be regularly maintained though, the others end up tending to be rather nitch in practice
23:44 <mniip> kuribas, it could be polymorphic
23:44 <glguy> kuribas: or it has a polymorphic type
23:44 <kuribas> not polymorphic...
23:44 <mniip> however RTTI is complicated enough that it's not out of consideration
23:44 <ertes> vtomole: haste is a non-GHC haskell compiler that targets JS
23:44 <ertes> it still works
23:44 eacamero_ joined
23:44 <kuribas> mniip: glguy, a Double
23:44 <mniip> are you sure it's the same expression
23:45 <ertes> vtomole: other compilers like JHC or UHC technically still work, but they aren't that useful, because you can forget most of hackage (haste has the same problem and is becoming obsolete – GHCJS)
23:45 <kuribas> mniip: I force the expression, but after :step ghci still goes into it...
23:45 <glguy> It's not enough to force an arbitrary expression, you need to force a particular variable
23:45 <kuribas> mniip: very annoying
23:45 <kuribas> glguy: I force _result
23:46 <kuribas> since it's already evaluated, why does it "enter" the expression again?
23:47 <mniip> 1488498153 [02:42:33] <ertes> Ch3ck: in fact it's specific to the GHC *compiler*
23:47 <mniip> that still creates a black hole
23:47 <mniip> just that it doesn't error out
23:47 <mniip> the thread subscribes to its own blackhole and everything goes into sleep
23:48 <Ch3ck> mniip, ertes I see
23:48 <Ch3ck> I'm still learning functional programming. I decided to take on haskell since I hear it's the core
23:49 <Ch3ck> Alot of my friends have told me stories about "monads" and "contextual structures"
23:49 <Ch3ck> Just interesting to find out how "hard" they are to understand ;-)
23:49 peterbecich joined
23:49 <ertes> Ch3ck: depends on how well you can deal with symbolic/algebraic thinking =)
23:49 <mniip> depends on what level of understanding you're aiming for
23:49 TxmszLou joined
23:50 <mniip> haskell (and abstract algebra) is one of those things where being able to reason about, and understanding, are two very different thing
23:50 <mniip> s
23:51 <kuribas> mniip, glguy: it isn't supposed to do that, is it?
23:51 <Ch3ck> mniip, I see
23:52 <ertes> Ch3ck: it helps to look at simpler structures first, like monoids, but try to accept that they are really just a set of mathematical axioms
23:52 <Ch3ck> I'm not at that point yet, just installed the GHC and sifting my way through
23:52 <glguy> kuribas: I don't know how _result is supposed to work, but if _result isn't a variable in your original program then it doesn't seem surprising that evaluating it might not affec your original program
23:52 <glguy> Maybe put the code and terminal session on lpaste?
23:52 <kuribas> ok
23:53 <kuribas> glguy: _result is the result of the expression that is under focus by ghci.
23:53 YongJoon joined
23:54 <kuribas> glguy: so after forcing it, it wouldn't need to descend into the expression, at least that's my understanding.
23:54 umib0zu joined
23:55 <kuribas> I'll paste something next time...
23:55 <glguy> or it's just a new name created with a copy of the expression that is under focus
23:55 <kuribas> glguy: if so, how do I make ghci skip that expression?
23:57 <* kuribas> guesses nobody else uses the ghci debugger...
23:57 <glguy> I don't know. GHCi's debugger isn't part of my workflow
23:58 <Ptival> what do I need to do to be able to import `test/Foo.hs` from `test/Bar.hs`?
23:58 ludat joined
23:59 <robkennedy> Ptival: if your cabal file says "hs-source-dir: test" it should work
23:59 <Ptival> robkennedy: thanks