<    April 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
00:00 bydo joined
00:02 MotherFlojo joined
00:04 systemfault joined
00:18 roboguy` joined
00:18 dni- joined
00:23 RoyalNightGuard joined
00:43 Thanzex joined
00:52 conal joined
01:05 yellowj joined
01:09 conal joined
01:17 begriffs joined
01:20 roboguy`_ joined
01:23 txx- joined
01:24 mac10688 joined
01:24 metalbot joined
01:26 txx- joined
01:27 <txx-> How can I use Nothing in a new type? E.g. for a Piece in tic-tac-toe, data Piece = X | O | Nothing
01:28 peterbec` joined
01:28 <geekosaur> you can't
01:29 <geekosaur> pattern matching relies on each constructor resolving to *one* type
01:29 <geekosaur> so Nothing cannot be both a Maybe <whatever> and a Piece
01:30 <txx-> Hmm, what's a suggested way to represent lack of a piece then?
01:31 mimi_vx_ joined
01:33 <geekosaur> use a different name.
01:33 <geekosaur> also see the discussion I just had with Squarism in #haskell: reusing a standard name ,makes things harder to understand
01:33 <geekosaur> NoPiece is perfectly usable...
01:35 conal joined
01:35 <txx-> Ok, thanks
01:35 mimi_vx_ joined
01:42 Youmu joined
01:43 peterbec` joined
01:44 thang1 joined
01:48 takle joined
01:49 malaclyps joined
01:51 sigmundv joined
01:52 takle_ joined
02:06 des_ joined
02:07 <des_> What is the most popular haskell testing framework?
02:07 dni- joined
02:07 <thang1> I hear quickCheck mentioned in an almost religious manner
02:09 <des_> OK, thanks thang1
02:12 <qu1j0t3> @karma+ thang1
02:12 <lambdabot> thang1's karma raised to 1.
02:14 <geekosaur> quickCheck isn;t really a framework
02:14 <geekosaur> I think tasty is one of the currently recommended frameworks, but there are a number of such
02:14 RoyalNightGuard joined
02:15 <geekosaur> QuickCheck does one particular kind of testing. Not all tests fit in its purview, which is why you want a test framework that lets you use QC or various other test sources
02:16 <MarcelineVQ> tasty and hspec are where I'd look for frameworks
02:18 MotherFlojo joined
02:32 nicknovitski joined
02:32 takle joined
02:33 <txx-> Can I define tic-tac-toe pieces like this?
02:33 <txx->
02:33 <txx-> data Piece = X | O deriving (Eq, Show)
02:33 <txx-> data Content = Piece | None deriving (Eq, Show)
02:33 <txx->
02:33 <txx-> The problem is that X and O are of type Piece, but not Content
02:34 <glguy> txx-: In: data Content = Piece | ...
02:34 <glguy> You're define a new constructor 'Piece'
02:34 <glguy> This constructor lives at the value level and has nothing to do with the type Piece
02:35 <glguy> txx-: What you *can* do is: data Content = Piece Piece , or data Content = ContentPiece Piece (to avoid reusing the name)
02:35 <txx-> Hmm...
02:35 <glguy> the *first* constructor is a value constructor (either Piece or ContentPiece)
02:35 <glguy> The second occurence of Piece is declaring that there's a field and that it's type is Piece
02:36 <txx-> Cool, I'll think that over
02:36 <txx-> @karma+ glguy
02:36 <lambdabot> glguy's karma raised to 57.
02:37 <glguy> txx-: Just a bit more, recall: data Maybe a = Just a | Nothing
02:37 <glguy> This defines a new type 'Maybe', new value 'Just' and 'Nothing', and says that 'Just' as a field with type 'a'
02:52 peterbec` joined
02:53 takle joined
02:57 meandi_2 joined
02:58 txx- left
02:58 exferenceBot joined
03:03 hexagoxel joined
03:06 peterbec` joined
03:08 takle joined
03:16 harfangk joined
03:26 takle joined
03:29 wedens joined
03:52 takle joined
03:54 Durbley joined
03:56 dni- joined
03:58 takle joined
04:02 rstefanic joined
04:02 systemfault joined
04:03 systemfault joined
04:04 conal joined
04:10 aarvar joined
04:11 peterbec` joined
04:12 conal joined
04:20 takle joined
04:33 takle joined
05:12 peterbec` joined
05:23 geekosaur joined
05:23 mac10688 joined
05:32 holygun joined
05:35 Gurkenglas joined
05:37 hphuoc25 joined
05:43 takle joined
05:45 dni- joined
05:50 kobigurk joined
06:04 mounty joined
06:25 xmonader3 joined
06:32 hphuoc25 joined
06:32 takle joined
06:34 govg joined
06:42 mounty joined
06:42 takle joined
06:54 thc202 joined
07:02 takle joined
07:08 peterbec` joined
07:34 dni- joined
07:36 xmonader2 joined
07:47 MotherFlojo joined
07:52 systemfault joined
07:54 systemfault joined
07:54 dni- joined
07:59 Guest91920 joined
08:05 justicefries left
08:05 delexi joined
08:10 colt44 joined
08:11 chbatey joined
08:27 yellowj joined
08:37 m3tti joined
08:37 takle joined
08:39 peterbec` joined
08:50 takle joined
09:05 Wedamm joined
09:10 takle joined
09:14 pbrant joined
09:16 takle joined
09:27 delexi joined
09:31 lithie joined
09:34 azahi joined
09:48 MotherFlojo joined
09:50 <xmonader2> http://lpaste.net/354666
09:50 chbatey joined
09:50 <xmonader2> am I using it correctly? monad reader
09:50 <xmonader2> also why i can't do simple io actions ?
10:00 Thanzex joined
10:11 MotherFlojo joined
10:15 holygun joined
10:25 haskelleksah joined
10:40 peterbec` joined
10:44 <haskelleksah> Hi all…I am currently on Chapter 9 in the HaskelBook where List is discussed, and I am having some hard time trying to “fully” understand certain aspect of what is being communicated. For example, a portion of the text used for explaining “spines and non strict evaluation” says:
10:44 <haskelleksah> “Because of this and the way nonstrict evaluation works, you can
10:44 <haskelleksah> evaluate cons cells independently of what they contain”
10:45 <haskelleksah> I am not sure I fully follow…the mental image I have built thus far of a cons cell, is a cell containing two pair of things…one is a value, the other is another con cell…
10:46 <haskelleksah> so what is actually meant by “evaluate cons cells independently of what they contain”? how is that possible? How does that look like?
10:47 albertus1 joined
10:49 <tuturto> haskelleksah: without seeing the book, I would guess you can traverse list built from cons cells, without evaluating the values cells contain
10:50 <tuturto> since a cell has value and link to next cell
10:50 <haskelleksah> tuturto: yeah, put that way (traverse instead of evaluate) it clicks more easily
10:50 <tuturto> so you would evaluate link to get to the next cell, without looking at the value
10:51 <tuturto> I should get that book too, I have heard good things about it
10:53 yellowj joined
10:53 kritzcreek_ joined
10:53 <haskelleksah> tuturto: it is def not a bad book…I have never attempted learning Haskell with any other material so I can compare it with anything else :)
10:54 binaryplease joined
10:56 netheranthem joined
11:08 <haskelleksah> cant*
11:22 Denthir joined
11:42 peterbec` joined
11:46 RoyalNightGuard left
11:48 azahi joined
11:53 <tuturto> haskelleksah: I'm just doing Yorgey's CIS 194, seems to have worked so far
11:57 asdfjklzozo joined
12:01 holygun joined
12:03 ederign joined
12:04 haskelleksah joined
12:09 <xmonader2> how asks function work for the reader monad?
12:09 <xmonader2> :t ask
12:09 <lambdabot> MonadReader r m => m r
12:09 <xmonader2> :t asks
12:09 <lambdabot> MonadReader r m => (r -> a) -> m a
12:15 colt44 joined
12:15 colt44 joined
12:28 smkz joined
12:31 sigmundv joined
12:41 RoyalNightGuard joined
12:42 Denthir joined
12:42 haskelleksah joined
12:43 jship joined
12:46 delexi joined
12:50 wei2912 joined
13:03 mizu_no_oto_work joined
13:19 jathan joined
13:28 earldouglas joined
13:29 Denthir joined
13:43 peterbec` joined
13:47 stef204 joined
13:49 RoyalNightGuard joined
13:56 guampa joined
13:59 govg joined
14:04 eacameron joined
14:07 joneshf-laptop joined
14:11 <adarqui_> hi
14:14 <machuga> Is there a name for the style of type signature that Haskell uses? I tend to just call them "Haskell-style type signatures" when referencing them. I've been unsuccessful at finding a formal name so I'm assuming they do not, but figured I'd ask nonetheless
14:18 <adarqui_> dno i call them haskell type signatures though. maybe ML-style type signature would be more appropriate for the -style variation
14:21 wildlander joined
14:22 delexi1 joined
14:31 takle joined
14:37 RoyalNightGuard joined
14:44 nobodyzxc joined
14:45 peterbec` joined
14:46 MotherFlojo joined
14:47 takle joined
14:50 carlomagno joined
14:50 kritzcreek_ joined
14:54 aarvar joined
14:56 takle joined
14:57 <xmonader2> anyone knows why I can't execute IO actions 'putStrLn' in a Reader function?
15:00 <geekosaur> because you need an IO monad somewhere
15:00 <geekosaur> Reader is ReaderT Identoty... no IO monad
15:00 <geekosaur> ReaderT IO would let you liftIO
15:01 delexi joined
15:04 jespada joined
15:04 uglyfigurine joined
15:06 nicknovitski joined
15:12 takle joined
15:14 conal joined
15:18 takle joined
15:19 <xmonader2> geekosaur, then maybe in a few weeks when i grasp monad transformers then ^_^
15:19 <xmonader2> thank you :)
15:20 <geekosaur> sounds to me like confusing monads with IO... IO is not special because it's a monad, IO is special because it's IO. http://www.vex.net/~trebla/haskell/IO.xhtml
15:31 yellowj joined
15:33 pixelfog joined
15:34 guampa joined
15:36 Ferdirand joined
15:37 <mizu_no_oto_work> xmonader2: the basic idea behind monad transformers isn't too difficult. Basically, just like you can have `instance Monad (->) r a`, you can also have `instance Monad m => Monad (->) r (m a)`
15:40 aarvar left
15:40 ksimon joined
15:46 <__rgn> can't you just have `m a` instead of `a` with regular Reader, why do you need a "monad transformer"
15:48 <Gurkenglas> mizu_no_oto_work, missed some brackets there
15:48 <adarqui_> i think because t (m a) (monad transformer) allows you to chain together many monads easy/simply with lift & such
15:48 <Gurkenglas> (actually the second one won't work without newtypes)
15:48 <adarqui_> i mean that's why you'd use the transformer in that case .. to stack multiple monads together
15:49 nicknovitski joined
15:51 <xmonader2> geekosaur, isn't IO instance of monad?
15:51 <geekosaur> yes, but the monad only does one thing: it enforces ordering
15:51 <geekosaur> you're thinking of it backwards
15:51 <geekosaur> monad is not the magic. IO is the magic
15:51 <geekosaur> IO being a monad is incidental
15:51 <xmonader2> mizu_no_oto_work, :D :D
15:52 <xmonader2> geekosaur, i should read that tutorial and get back
15:56 azahi joined
15:58 conal joined
16:08 govg joined
16:18 wildlander joined
16:27 albertus1 joined
16:29 peterbecich joined
16:31 kadoban joined
16:40 Ferdirand joined
16:41 sigmundv joined
16:45 alibabzo joined
16:46 peterbec` joined
16:56 pilne joined
17:01 holygun_ joined
17:02 malaclyps joined
17:04 <mizu_no_oto_work> __rgn: for `Monad (->) r a`, `return = const`. For `Monad (->) r (m a)`, `return = const . return`
17:06 <mizu_no_oto_work> The difference between the two is that the monad transformer version calls return/fmap/join/>>= on some "underlying" monad in addition to what the "base" monad has to do.
17:08 <mizu_no_oto_work> For example, for the monad `r -> Maybe a`, with the monad transformer approach `return :: a -> r -> Maybe a`. `fmap :: (a -> b) -> (r -> Maybe a) -> (r -> Maybe b)`
17:08 <mizu_no_oto_work> Whereas with the normal Reader monad, `return :: Maybe a -> r -> Maybe a`. `fmap :: (Maybe a -> b) -> (r -> Maybe a) -> (r -> b)`
17:09 <mizu_no_oto_work> `r -> Maybe a` is isomorphic to ReaderT Maybe a, FWIW.
17:10 RoyalNightGuard joined
17:10 <mizu_no_oto_work> :t fmap . fmap
17:10 <lambdabot> (Functor f, Functor f1) => (a -> b) -> f1 (f a) -> f1 (f b)
17:11 <mizu_no_oto_work> Basically, the monad transformer approach allows you to use fmap instead of (fmap . fmap), among other things.
17:12 <mizu_no_oto_work> > (fmap . fmap) (+ 1) (\r -> Just 5) $ ()
17:12 <lambdabot> Just 6
17:13 <mizu_no_oto_work> > (fmap . fmap) (+ 1) (\r -> Just (r + 2)) $ 2
17:13 <lambdabot> Just 5
17:15 holygun joined
17:20 Denthir joined
17:20 howdoi joined
17:23 yellowj joined
17:26 <sudoreboot[m]> What does `m (a -> b) -> m a -> m b` mean? How does`m (a -> b)` differ from `m a -> m b`?
17:28 <srhb> sudoreboot[m]: Can you give an example value of each type?
17:28 <srhb> sudoreboot[m]: Or perhaps just `m (a -> b)` for some specific `m`
17:28 <* sudoreboot[m]> sent a long message: sudoreboot[m]_2017-04-17_17:28:53.txt - https://matrix.org/_matrix/media/v1/download/matrix.org/tOJeAuxdmdftqBwhgPpBaTDq
17:29 <srhb> sudoreboot[m]: OK, here's one: (Just id)
17:29 <srhb> That's m (a -> a)
17:29 chlong joined
17:30 <sudoreboot[m]> srhb: I think I see
17:30 <srhb> Well, it's Maybe (a -> a) but you get the point :-)
17:31 <srhb> :t \x -> x >>= return
17:31 <lambdabot> Monad m => m b -> m b
17:31 <srhb> :t \x -> x >>= return . (undefined :: a -> b)
17:31 <lambdabot> Monad m => m a -> m b
17:32 RoyalNightGuard joined
17:36 <sudoreboot[m]> srhb: Thanks, after some consideration I can make sense out of it
17:37 <srhb> sudoreboot[m]: Great. :)
17:40 guampa joined
17:41 govg joined
17:47 peterbec` joined
17:50 asdfjkljkl joined
17:51 ederign_ joined
17:51 <asdfjkljkl> off-topic: stack and ghc-mod are awesome
17:51 <asdfjkljkl> blessed be their creators
17:51 <Akii> ++
17:51 <Akii> nuf said
17:53 uglyfigurine joined
17:53 holygun joined
18:01 guampa joined
18:02 mojjo joined
18:02 bungoman_ joined
18:06 GreySunshine joined
18:08 yellowj joined
18:09 <GreySunshine> Hello I'm trying to install hakyll with 'stack install hakyll' in my home directory, It says 'killed', how should I install hakyll?
18:15 NeverDie joined
18:16 dni- joined
18:17 Ferdirand joined
18:18 guampa joined
18:24 <geekosaur> add memory
18:24 <geekosaur> or swap
18:24 <geekosaur> if your system uses binutils ld, consider installing gold instead
18:27 chlong joined
18:27 nullcone joined
18:32 mac10688 joined
18:47 Ferdirand joined
18:54 mengu joined
18:54 <thang1> Or ldd, which is even faster
18:55 RoyalNightGuard joined
18:57 <geekosaur> less interested in faster here than just reducing the mmeory usage so the OOM killer doesn't nuke it
18:58 MotherFlojo joined
19:08 Rodya_ joined
19:17 Thanzex joined
19:19 Ferdirand joined
19:29 Eiji joined
19:31 <Eiji> hey guys i need some help. is there something i can use to convert do-notation code to >>= | >> ??
19:31 <geekosaur> @undo do { a <- b; c a }
19:31 <lambdabot> b >>= \ a -> c a
19:31 <geekosaur> might want to do it in /query
19:32 <Eiji> ah there's a bot on IRC. Nice. Thank you very much sir :D
19:32 <Akii> ./msg lambdabot @undo do { a <- b; c a }
19:49 peterbec` joined
19:51 <thang1> /msg lambdabot @undo do { a <- b; c a }
19:51 <thang1> whoops, been a long time since I made that mistake lol
19:51 thebardian joined
19:52 <Akii> https://9gag.com/gag/a0bEOmO
19:52 <Akii> eer sry
19:52 <Akii> wrong chat
19:53 <Akii> that's what happens if you use unsafePerformIO folks
19:53 <Akii> *flies away*
19:59 malaclyps joined
20:04 RoyalNightGuard joined
20:05 dni- joined
20:08 ksimon joined
20:14 govg joined
20:17 thebardian joined
20:26 jud^ joined
20:50 Thanzex joined
20:50 peterbec` joined
21:01 Rodya_ joined
21:01 mizu_no_oto_work joined
21:06 Rodya_ joined
21:09 takle joined
21:10 takle_ joined
21:11 des_ joined
21:21 mengu joined
21:33 takle joined
21:50 azahi joined
21:53 hiratara joined
21:54 dni- joined
21:59 taksuyu joined
22:02 dni- joined
22:04 ksimon joined
22:15 USBoss joined
22:21 USBoss joined
22:31 hiratara joined
22:48 mimi_vx joined
22:52 peterbec` joined
23:03 ksimon joined
23:45 zero_byte joined
23:49 dibblego joined
23:53 peterbec` joined