Search Haskell Channel Logs

Sunday, March 5, 2017

#haskell channel featuring Cale, spatial, cocreature, ferlif, mbw, roundhouse,

recur22 2017-03-04 20:47:53
i'm looking haskage trying to find good library for teaching but all i can find is either bindings or unnecessarily verbose package
mbw 2017-03-04 20:53:19
Is it a convention that Haskell array code is done using indices starting at 1? I get the impression from the tutorials I've been looking at.
Cale 2017-03-04 21:03:22
mbw: There's no convention -- Ix lets you choose whatever bounds make the most sense for your application.
Cale 2017-03-04 21:03:40
(if you want to start an array at 137, you can do that)
Cale 2017-03-04 21:04:07
0 would usually be preferred, all else being equal though
spatial 2017-03-04 21:10:02
http://pastebin.com/LxzCpQgE I have errors in this code.
spatial 2017-03-04 21:10:20
Trying a State Monad to store a global array.
spatial 2017-03-04 21:10:58
storearray "value-table" ( newArray (512,512) 0 ) has a problem.
spatial 2017-03-04 21:14:12
I guess the pattern will work if I remove the errors.
ferlif 2017-03-04 21:17:49
ciao
mbw 2017-03-04 21:18:59
Cale: Ok, that's good to know.
cocreature 2017-03-04 21:24:55
mbw: these days https://hackage.haskell.org/package/vector is arguably the most common implementation of arrays and it uses 0 based indices
roundhouse 2017-03-04 21:34:12
hi, how can I reference a type of the sourrounding environment? If I have "f :: (Monad m) => m (); f = g; where g :: m ()...) I get an error that the the monad of g m1 can't be matched with the one of f.