<    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:11 Rizy joined
00:13 roboguy` joined
00:26 hoffmeyer joined
00:29 MotherFlojo joined
00:31 Rodya_ joined
00:43 eacameron joined
00:44 aarvar joined
00:45 Heasummn joined
00:46 fajpunk joined
00:50 <fajpunk> I'm working through the Haskell boook (0.12.0), and I'm on page 814, where there's snippet:
00:50 <fajpunk> relude> (fmap . fmap) sum Just [1, 2, 3]
00:50 <fajpunk> Just 6
00:50 hphuoc25 joined
00:50 <fajpunk> I don't understand how the types work out there.
00:50 <fajpunk> I've started with each part of that expression, and made my way to where I understand:
00:51 <fajpunk> Prelude> (fmap . fmap) sum Just [1, 2, 3]
00:51 <fajpunk> Just 6Y
00:51 <fajpunk> Oops, sorry
00:51 <fajpunk> > :t (fmap . fmap) sum
00:51 <fajpunk> (fmap . fmap) sum
00:51 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
00:51 <fajpunk> :: (Num b, Foldable t, Functor f, Functor f1) =>
00:51 <fajpunk> f1 (f (t b)) -> f1 (f b)Y
00:52 <fajpunk> But then:
00:52 <fajpunk> :t (fmap . fmap) sum Just
00:52 <lambdabot> (Foldable t, Num b) => t b -> Maybe b
00:54 <fajpunk> I don't understand how both f1 and f disappear from the lhs, while only f1 disappears from the rhs :(
00:54 <fajpunk> Can anyone offer any insight?
00:56 Heasummn joined
00:57 <geekosaur> function application is a functor
00:57 <geekosaur> (this is a bit mind-bending until you get used to it)
00:58 Rodya_ joined
00:58 <geekosaur> it's also an Applicative and a Monad (the latter is sometimes used directly and sometimes used with a newtype: ReaderT)
00:59 <fajpunk> Right, this is the chapter on Reader :)
00:59 <fajpunk> So is the Just there acting as a function application?
00:59 <geekosaur> Just is one of the functors that went away. the *way* it went away required that the second functor be ((->) e)
01:01 madjestic joined
01:03 <fajpunk> Ohhhhhhhhhhhhhhhh... I think I get it now
01:04 <fajpunk> I'll chew on that for a while. Thanks geekosaur!
01:06 Heasummn joined
01:06 <geekosaur> it'll take some chewing :) but it's fairly powerful once you understand it
01:07 <geekosaur> although it often leads to code that is impenetrable even by experts (a couple years ago one of the #haskell regulars posed an "impossible" fold to the channel that turned out to be clever use of the function application functor)
01:10 louispan joined
01:10 lithie joined
01:11 Rodya_ joined
01:13 Rodya__ joined
01:16 Heasummn joined
01:16 \Mike joined
01:20 wei2912 joined
01:26 Heasummn joined
01:27 hoffmeyer joined
01:36 Heasummn joined
01:47 Heasummn joined
01:53 faberbrain joined
01:57 Heasummn joined
02:01 eacameron joined
02:06 Heasummn joined
02:16 Rizy joined
02:20 conal joined
02:28 hoffmeyer joined
02:29 eacameron joined
02:29 harfangk joined
02:32 eacamero_ joined
02:43 eacameron joined
02:52 Rizy joined
02:54 chlong_ joined
02:56 louispan joined
03:06 Heasummn joined
03:09 eacameron joined
03:10 MotherFlojo joined
03:12 flounders joined
03:29 hoffmeyer joined
03:29 staffehn joined
03:30 pdgwien- joined
03:31 MotherFlojo joined
03:34 Geekingfrog_ joined
03:35 Hijiri_ joined
03:35 xsmalbil_ joined
03:35 Bane^^ joined
03:35 ploop_ joined
03:35 mcspud- joined
03:36 amuck_ joined
03:36 Cthalupa joined
03:37 asivitz joined
03:41 gpolitis joined
03:43 amatecha joined
03:44 louispan joined
03:44 unclechu joined
03:47 MotherFlojo joined
03:49 qu1j0t3 joined
03:49 AlainODea joined
03:49 curry[m] joined
03:49 SaidinWoT joined
03:49 buoto joined
03:49 zph joined
03:49 metalrain joined
03:49 Phillemann joined
03:49 majoh joined
03:52 exferenceBot joined
03:54 Cthalupa joined
03:55 faberbrain joined
03:57 hexagoxel joined
03:58 smwangi joined
04:02 MotherFlojo joined
04:06 Heasummn joined
04:10 roboguy` joined
04:17 Rodya_ joined
04:19 eacameron joined
04:25 Rizy joined
04:29 hoffmeyer joined
04:40 malaclyps joined
04:40 malaclyps joined
04:41 systemfault joined
04:42 hexagoxel joined
04:43 louispan joined
04:43 blissdev joined
05:05 meck joined
05:06 Heasummn joined
05:14 Heasummn joined
05:18 tnks joined
05:24 hexagoxel joined
05:28 begriffs joined
05:33 Rizy joined
05:54 <ski> geekosaur : which was that ?
05:57 faberbrain joined
06:11 lithie joined
06:19 MotherFlojo joined
06:20 xmonader joined
06:21 monochrom joined
06:32 hexagoxel joined
06:51 Kuros` joined
06:56 Pupnik joined
06:59 mounty joined
07:00 fajpunk joined
07:06 mounty joined
07:09 hexagoxel joined
07:11 Vzox01 joined
07:16 mounty joined
07:20 Rodya_ joined
07:35 MotherFlojo joined
07:36 aniketd joined
07:36 <lpaste_> Vzox01 pasted “parsec error” at http://lpaste.net/353447
07:36 zero_byte joined
07:38 <Vzox01> Hello, everyone, I've pasted a small problem I'm having with the type system here: http://lpaste.net/353447 I'm getting errors that I can't fully understand, so I can't figure out what am I doing wrong?
07:41 <Cale> Vzox01: Did you try adding {-# LANGUAGE TypeFamilies #-} to the top of your source file?
07:41 <Vzox01> Cale: let me try
07:44 <Cale> Vzox01: any luck?
07:44 <Vzox01> Cale: now I get this error: http://lpaste.net/353448 *scratches head*
07:45 <Cale> Ah, that type signature you've given to prefixParser looks suspicious
07:45 <Cale> I'm fairly sure it's really prefixParser :: Parser (String -> Command)
07:46 <Vzox01> oooooh! yes it is! it worked!
07:47 <Vzox01> such a simple mistake *facepalm*, thank you
07:47 <Cale> The Read type class gives you the ability to make values of the given type, but it doesn't give you any additional ability to consume them
07:59 faberbrain joined
07:59 <Vzox01> Yes, I got confused because in my head I was thinking that I'm just returning a constructor, but that wasn't at all what I was doing because of (f . read). It's an interesting example of how a program in your head can differ from what you've actually written :D. I'm still trying to figure out why do I need TypeFamilies, but I'm reading about it on wiki.
08:01 <Cale> You basically need it just because the current Parsec you're using uses it.
08:04 Rizy joined
08:09 Fuuzetsu joined
08:09 xsmalbil joined
08:11 joneshf-laptop joined
08:11 sbrg joined
08:11 sbrg joined
08:18 hexagoxel joined
08:18 expo873 joined
08:20 suls joined
08:21 Rodya_ joined
08:23 suls joined
08:25 mojjo joined
08:27 hphuoc25 joined
08:36 louispan joined
08:37 ThomasLocke joined
08:38 hexagoxel joined
08:39 louispan joined
08:43 dni- joined
08:53 smwangi joined
08:58 louispan joined
09:01 faberbrain joined
09:11 hexagoxel joined
09:15 albertus1 joined
09:16 owiecc joined
09:22 Rodya_ joined
09:32 feamcor joined
09:34 Ferdirand joined
09:37 Glooomy joined
09:42 Durz0 joined
09:43 dni-_ joined
09:45 Uniaika joined
09:46 hexagoxel joined
09:51 curious_corn joined
10:04 ThomasLocke joined
10:07 kritzcreek_ joined
10:20 curious_corn joined
10:22 Rodya_ joined
10:29 thc202 joined
10:30 madjestic joined
10:32 kini joined
10:38 skapazzo joined
10:39 nacon joined
10:46 pbrant joined
10:50 owiecc joined
10:51 Rizy joined
11:04 MotherFlojo joined
11:06 hexagoxel joined
11:18 Zialus joined
11:22 louispan joined
11:23 Gurkenglas joined
11:23 Rodya_ joined
11:28 suls joined
11:34 janitor1 joined
11:41 faberbrain joined
11:44 <Vzox01> When I have a sum data type for example 'Tt = Aa Int | Bb Int' is there a way in Haskell to do something like "reflection" and get a list of possible constructors of a data type? I'm just curious and it's probably a bad idea
11:48 <Cale> Vzox01: Yeah, there's Data.Data https://downloads.haskell.org/~ghc/latest/docs/html/libraries/base-4.9.0.0/Data-Data.html which you can derive using an extension
11:49 <Cale> > dataTypeOf (undefined :: Either String Integer)
11:49 <lambdabot> DataType {tycon = "Prelude.Either", datarep = AlgRep [Left,Right]}
11:50 <Cale> > dataTypeConstrs (dataTypeOf (undefined :: Either String Integer))
11:50 <lambdabot> [Left,Right]
11:51 <Cale> Note: that's a list of values of type Constr, which somewhat confusingly show themselves using the original constructors' names
11:51 <Cale> > map constrFixity (dataTypeConstrs (dataTypeOf (undefined :: Either String Integer)))
11:51 <lambdabot> [Prefix,Prefix]
11:55 <Vzox01> Cole: Wow, thank you! This language is amazing
11:56 <Cale> http://hackage.haskell.org/package/syb -- this package has a bunch of tools for working generically with instances of the Data class -- there are all kinds of generic traversals you can do.
12:07 skapazzo joined
12:09 Rizy joined
12:16 shayan_ joined
12:16 tsmish joined
12:24 Rodya_ joined
12:26 suls joined
12:26 chlong_ joined
12:28 Glooomy joined
12:31 grayjoc joined
12:31 feamcor left
12:33 curious_corn joined
12:43 Ferdirand joined
12:54 teppic joined
12:58 Rizy joined
12:59 lithie joined
13:05 MotherFlojo joined
13:05 curious_corn joined
13:05 eacameron joined
13:11 SudhanshuJ joined
13:11 simendsjo joined
13:19 <lpaste_> suds pasted “Printing a tictactoe grid” at http://lpaste.net/353460
13:21 <SudhanshuJ> I was playing and trying to make my own tic tac toe game from Graham Hutton's book. I am however having trouble trying to implement a simpler version of printing the tic tac toe gird
13:23 <SudhanshuJ> the relevant sections of the code is posted on http://lpaste.net/353460
13:25 Rodya_ joined
13:30 hphuoc25 joined
13:38 owiecc joined
13:40 grayjoc joined
13:41 Deide joined
13:42 faberbrain joined
13:45 takle joined
13:46 teppic joined
13:51 <Vzox01> Cale, thanks for your help, but after reading syb's docs for a while and experimenting I feel like I have veered into the twilight zone, perhaps someday I'll be able to wrap my head around Data.Generics and Data.Data but for now it seems too confusing
14:01 SudhanshuJ joined
14:02 Lempr joined
14:02 pie_ joined
14:02 <Lempr> Hi anyone can help me with grouping by equlations relations ? http://lpaste.net/4041273696768229376 If there is any simple solution without writing my own function
14:03 Durbley joined
14:07 hphuoc25 joined
14:10 NoCreativity joined
14:15 curious_corn joined
14:18 janitor joined
14:21 janitor1 joined
14:21 takle joined
14:29 janitor1 joined
14:30 stef204 joined
14:39 janitor1 joined
14:42 janitor1 joined
15:06 MotherFlojo joined
15:09 smichel17_ joined
15:14 Zialus joined
15:14 Gurkenglas_ joined
15:19 anieuwland joined
15:20 teppic joined
15:26 Rodya_ joined
15:30 <anieuwland> Hi! Does anyone know how to detect connected devices to a linux computer in Haskell?
15:33 takle joined
15:34 <qu1j0t3> anieuwland: What kind of device?
15:35 <anieuwland> Ereaders through usb (a Sony Reader, appears as two vfat file systems)
15:35 <anieuwland> qu1j0t3: that or android phones
15:40 <geekosaur> there should be a binding for libusb on hackage. beyond that could either be a binding to getmntent() and friends, or to a userspace vfs (e.g. gvfs)
15:40 asante10111 joined
15:42 kagcc joined
15:43 <anieuwland> geekosaur: Thanks, I'll look into. I did find libudev, but it's last release is from 2013. Think that's any good?
15:44 <geekosaur> I don't know, sorry
15:44 <anieuwland> ok thanks
15:44 faberbrain joined
15:51 metalbot joined
15:54 Big_G joined
16:04 mizu_no_oto_work joined
16:05 wildlander joined
16:16 Uniaika joined
16:19 argent0 joined
16:25 takle joined
16:27 Rodya_ joined
16:31 janitor joined
16:40 Uniaika joined
16:43 janitor1 joined
16:54 xmonader2 joined
16:56 takle joined
17:06 pie_ joined
17:06 pie_ joined
17:07 MotherFlojo joined
17:21 Uniaika joined
17:24 janitor1 joined
17:26 fajpunk joined
17:27 takle_ joined
17:28 Rodya_ joined
17:29 janitor1 joined
17:36 janitor joined
17:36 eldiz joined
17:37 Rodya_ joined
17:38 SudhanshuJ joined
17:40 kini joined
17:45 eacameron joined
17:46 faberbrain joined
17:47 tsmish joined
17:48 mac10688 joined
17:52 Guest91320 joined
17:53 blissdev joined
17:57 takle joined
18:14 mengu joined
18:15 baldfat_ joined
18:18 <Tene> hm, aniewuland doesn't appear to be around, but you can always go crawling around in /sys/bus/usb/devices/ with normal filesystem operations
18:32 netheranthem joined
18:37 Heasummn joined
18:47 faberbrain joined
18:55 conal joined
18:56 hoffmeyer joined
19:05 takle joined
19:07 MotherFlojo joined
19:12 takle joined
19:19 flounders joined
19:21 <zaquest> > [0.0, 8.0 .. 11.0]
19:21 <lambdabot> [0.0,8.0]
19:21 <zaquest> > [0.0, 8.0 .. 12.0]
19:21 <lambdabot> [0.0,8.0,16.0]
19:21 <zaquest> why? ;_;
19:22 stef204 joined
19:25 <geekosaur> that gets argued out every so often, I don't think anyone has managed to fully justify why the Report defines its behavior that way
19:26 <geekosaur> in theory it has to do with Float/Double (IEEE 754) instability, so iirc it does the equivalent of 4/5 rounding (that is, below the midpoint "rounds" down, midpoint or above "rounds" up)
19:26 \Mike joined
19:27 <geekosaur> but most discussions at that point divert to how Float and Double shouldn't have Enum instances anyway and yay bikeshed :p
19:28 <geekosaur> (maybe that's why the Report says what it does, they got tired of the bikeshedding and just did something dumb/simple....)
19:30 <zaquest> ok
19:33 takle joined
19:33 takle joined
19:37 takle joined
19:41 <monochrom> "the list terminates when the elements become greater than e3 + i∕2 for positive increment i"
19:42 <monochrom> In this example, i = 8 - 0, e3 = 12.
19:44 conal joined
19:45 <monochrom> It has merits when i is small and e3 is imperfect (e.g., you intend e3 = 1/3 but the floating point version happens to be just below 1/3)
19:54 MotherFlojo joined
19:55 djfo joined
19:56 Uniaika joined
20:03 mengu_ joined
20:11 Big_G joined
20:13 aarvar joined
20:17 emmanuel_erc joined
20:18 jorris joined
20:21 takle joined
20:25 conal joined
20:27 mengwong joined
20:29 benley joined
20:32 grayjoc joined
20:46 Miroboru joined
20:46 takle joined
20:49 faberbrain joined
21:02 Rodya_ joined
21:03 smichel17 joined
21:15 Rodya_ joined
21:15 merijn joined
21:28 gpolitis joined
21:31 louispan joined
21:53 hiratara joined
21:58 Uniaika joined
22:02 conal joined
22:10 peterbecich joined
22:17 jorris joined
22:31 hiratara joined
22:32 louispan joined
22:36 shayan_ joined
22:42 AndreasK joined
22:51 faberbrain joined
22:51 Rodya_ joined
23:03 argent0 joined
23:06 cschneid_ joined
23:06 MotherFlojo joined
23:14 neophytes joined
23:16 contiver joined
23:24 tsmish joined
23:31 neophytes left
23:34 louispan joined
23:36 Pupnik joined
23:39 mengu joined
23:41 malaclyps joined
23:41 bno1 joined
23:49 justicefries left
23:56 Rodya_ joined
23:59 Xlaech joined