<    June 2018     >
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 _2_2 23  
24 25 26 27 28 29 30
00:01 bydo joined
00:36 progfun joined
00:38 conal_ joined
00:39 progfun joined
00:44 ma489 joined
00:49 taumuon joined
00:49 mounty joined
00:51 justaguest joined
00:52 progfun joined
01:00 Linter joined
01:01 bbrodriguez joined
01:08 Pupnik joined
01:19 conal_ joined
01:19 vurtz joined
01:22 andreabe_ joined
01:24 carlomagno joined
01:32 patbecich joined
01:41 Linter joined
01:42 patbecich joined
02:20 MarcelineVQ joined
02:21 jsondavis joined
02:25 mizu_no_oto_work joined
02:42 fading joined
02:45 kroomey joined
02:50 nicht joined
02:52 progfun joined
02:54 AetherWind joined
02:56 progfun_ joined
03:01 progfun_ joined
03:02 ToffeeYogurtPots joined
03:07 progfun_ joined
03:08 progfun joined
03:09 progfun__ joined
03:13 justaguest joined
03:25 shafox joined
03:45 progfun joined
03:56 jsondavis joined
03:59 Linter joined
04:16 progfun joined
04:26 progfun joined
04:33 kroomey joined
04:37 conal_ joined
04:47 martinga_ joined
04:49 carlomagno1 joined
04:53 progfun joined
05:09 slomo joined
05:09 slomo joined
05:09 qubitrot joined
05:17 kroomey joined
05:32 andreabe_ joined
05:43 justaguest joined
05:53 sulan_ joined
05:55 mac10688 joined
05:55 hamishmack joined
06:17 kapil___ joined
06:23 obi_jan_kenobi_ joined
06:30 Linter joined
06:43 <taumuon> using the Control.Lens library, can I run a function over a single record and return a new copy of the data? for example I'd like to do (+1) on a state^.x and return new copy of state with x = x+1
06:49 hphuoc25 joined
06:59 sQVe joined
06:59 sQVe joined
06:59 sQVe joined
07:11 zakora joined
07:14 nickolay_ joined
07:16 thc202 joined
07:25 hphuoc25 joined
07:40 zero_byte joined
07:40 Folkol_ joined
07:46 <suppi> taumuon: `over x (+1) state` does that
07:47 hphuoc25 joined
07:48 <suppi> https://hackage.haskell.org/package/lens-4.16.1/docs/Control-Lens-Setter.html#v:over
07:48 sulan_ joined
07:53 <taumuon> suppi: thank you, i don't know how i missed it
07:54 <suppi> np
08:02 curious_corn joined
08:13 curious_corn joined
08:13 __sulan__ joined
08:20 curious_corn_ joined
08:25 merijn joined
08:25 b-b joined
08:25 hphuoc25 joined
08:30 asante joined
08:30 asante joined
08:31 progfun joined
08:32 asante joined
08:32 asante joined
08:34 nickolay_ joined
08:34 curious_corn joined
08:37 hphuoc25 joined
08:41 hphuoc25 joined
08:48 curious_corn_ joined
08:58 Folkol_ joined
09:00 Linter joined
09:04 fabsn joined
09:25 hphuoc25 joined
09:40 LKoen joined
09:44 zakora joined
09:44 kmelva joined
09:44 juri2mol joined
09:45 emilypi joined
09:46 asante joined
09:47 <juri2mol> hi folks! I'm hoping somebody could help me with Data.Map.insertWith
09:48 <juri2mol> The function is `insertWith :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a`, however, I have a use case where `insertWith :: Ord k => (a -> b -> a) -> k -> b -> Map k a -> Map k a` would be more useful
09:49 will_ joined
09:50 <juri2mol> is there any reason why this generalization wouldn't work? I am hesitant to implement it right away, because looking at the source code, insertWith seems pretty optimized on some lower levels that I don't fully understand: http://hackage.haskell.org/package/containers-0.5.11.0/docs/src/Data.Map.Strict.Internal.html#insertWith
09:52 <juri2mol> if you're curious, my use case would be to insert an element into `Map k [v]` with (:) instead of (++)
09:54 Folkol_ joined
09:55 hphuoc25 joined
09:56 jsondavis joined
10:00 curious_corn joined
10:01 Folkol_ joined
10:03 machinedgod joined
10:11 progfun joined
10:14 Folkol_ joined
10:16 lumm joined
10:27 hphuoc25 joined
10:51 curious_corn joined
10:52 Folkol_ joined
11:07 Gurkenglas joined
11:15 emilypi joined
11:26 vurtz joined
11:30 Linter joined
11:35 malaclyps joined
12:01 justaguest joined
12:02 nschoe joined
12:06 TCZ joined
12:08 jccp joined
12:09 jle` joined
12:10 emilypi joined
12:10 Folkol_ joined
12:16 rotcev joined
12:18 progfun joined
12:18 vurtz joined
12:25 curious_corn joined
12:26 louispan joined
12:31 sQVe joined
12:33 acarrico joined
12:34 Linter joined
12:49 nschoe joined
12:49 pfurla joined
12:50 andreabedini joined
13:00 kapil___ joined
13:03 Big_G joined
13:06 curious_corn joined
13:09 zakora joined
13:10 curious_corn joined
13:20 pbrant joined
13:26 jsondavis joined
13:29 iAmerikan joined
13:39 Linter joined
13:50 emilypi joined
13:52 Gurkenglas joined
13:55 Gurkenglas joined
13:59 vurtz joined
14:00 progfun joined
14:01 justaguest joined
14:01 mounty joined
14:04 aarvar joined
14:22 matsurago joined
14:27 curious_corn joined
14:33 iAmerikan joined
14:49 mounty joined
15:00 mounty joined
15:02 Folkol_ joined
15:28 bbrodriguez joined
15:29 progfun joined
15:33 progfun joined
15:34 progfun joined
15:35 progfun joined
15:36 progfun joined
15:36 progfun joined
15:47 veryuniqkname joined
15:50 <veryuniqkname> hello everyone. Is there any way to convert Prt Word8 to ByteArray?
16:00 louispan joined
16:02 Big_G joined
16:06 Gurkenglas joined
16:10 Linter joined
16:13 pie_ joined
16:23 conal_ joined
16:29 hphuoc25 joined
16:36 conal_ joined
16:36 obi_jan_kenobi_ joined
16:40 xpycm joined
16:42 rzp joined
16:48 hvr joined
16:49 Big_G joined
16:51 nckx joined
16:55 netheranthem joined
17:03 drewr joined
17:03 <dminuoso> veryuniqkname: BS has Data.ByteString.Char8.packCString and packCStringLen
17:08 vurtz joined
17:11 chrisdotcode joined
17:18 pfurla joined
17:19 <veryuniqkname> dminuoso thank you
17:20 jsondavis joined
17:26 louispan joined
17:33 dedgrant joined
17:36 emilypi joined
17:49 iAmerikan joined
17:50 giraffe joined
17:51 ToffeeYogurtPots joined
17:52 Durbley joined
18:03 replay joined
18:06 nacon joined
18:06 nacon joined
18:17 Ariakenom joined
18:23 MarcelineVQ joined
18:25 iAmerikan joined
18:31 scampbell joined
18:40 Linter joined
18:40 obi_jan_kenobi_ joined
18:47 bbrodriguez joined
19:06 filwisher joined
19:14 Deide joined
19:22 iAmerikan joined
19:26 Basu joined
19:27 Basu left
19:27 Basu joined
19:28 <Basu> Hi I am building a simple console app, but I want to test my main loop, basically I would like to mock out getLine so that I can pass different commands
19:29 <Basu> something like this: https://lpaste.net/2505383315725352960
19:30 vurtz joined
19:31 <Basu> basically I can mock IO String with another function, but if I want the function to return first say 'c' then on the next call 'l' and so on
19:31 <Basu> I don't know how I can maintain a state in that function itself
19:32 <dminuoso> Basu: If you decompose your code cleanly and extra pure behavior into pure functions, you dont need to mock anything.
19:32 <Basu> I have extracted as much as I could, but in the end the main needs to run a forever loop waiting for user input
19:33 <Basu> depending on the input it will do something which will then return the next state
19:35 <dminuoso> Basu: What exactly do you want to test?
19:35 <dminuoso> What behavior or property are you looking at?
19:36 <Basu> ok so you run a classic forever loop, on each iteration you call getLine
19:36 <Basu> then you parse getLine to a command
19:36 <Basu> then you run the command
19:37 <Basu> and then you go back to running the loop again unless you see the quit command
19:37 <Basu> in between the output of the command is displayed on the screen
19:38 <Basu> so I want to mock: getLine to run a series of inputs and putStrLn to collect the output strings
19:38 <monochrom> You could use IORef
19:39 <dminuoso> Basu: Why not simply test runCommand? It seems as if you don't need IO to talk about this.
19:39 <Basu> yes I have completely tested runCommand
19:39 <Basu> without any IO whatsoever
19:39 <dminuoso> Basu: Then again - what particular *behavior* or *property* do you want to test?
19:40 <Basu> the behavior that the game keeps running until the q command
19:40 <Basu> and displays the right canvas on the console
19:40 <Basu> I know its a bit of an extreme of TDD
19:42 Arcaelyx_ joined
19:43 <dminuoso> Basu: what is the type of runCommand?
19:43 <Basu> runCommand :: String -> Canvas -> CanvasState
19:43 <Basu> data CanvasState = CanvasState {replState:: ReplState, canvas:: Canvas} deriving (Eq)
19:44 <dminuoso> Basu: And ReplState?
19:44 <Basu> data ReplState = ReplContinue | ReplContinueAfterInvalidInput String | ReplQuit deriving (Eq, Show)
19:45 <Basu> I have been thinking of using a file to write my output and read my commands from a file
19:45 mcmuru joined
19:48 mortum5 joined
19:58 conal_ joined
20:10 emilypi joined
20:36 fabsn joined
20:54 replay joined
21:09 Linter joined
21:17 pbrant joined
21:35 iAmerikan joined
21:41 pie_ joined
21:43 LKoen joined
21:49 TCZ joined
21:52 hiratara joined
21:54 LKoen joined
22:04 scampbell joined
22:22 averell joined
22:25 bbrodriguez joined
22:31 hiratara joined
22:32 hamishmack joined
22:33 leothrix joined
22:35 conal_ joined
22:38 Gurkenglas_ joined
22:41 iAmerikan joined
23:06 louispan joined
23:15 _ikke_ joined
23:22 jle` joined
23:25 mud joined
23:36 taumuon joined
23:40 Linter joined
23:41 hphuoc25 joined
23:45 Gurkenglas joined
23:46 _ikke_ joined
23:52 pfurla joined