Search Haskell Channel Logs

Sunday, March 5, 2017

#haskell channel featuring roundhouse, spatial, cocreature,

spatial 2017-03-04 21:49:06
http://pastebin.com/mQcJJ4f5 I've changed and now the last function 'BoardState' has errors. Why ?
spatial 2017-03-04 21:49:31
* Couldn't match type `(,) (Maybe (IOArray Int Int))' with `IO'
cocreature 2017-03-04 22:01:20
spatial: putmutablearray first calls "newArray" so the do block has to be of type IO a for some a, but then it calls storearray which is of type State … … but State and IO are not the same thing
cocreature 2017-03-04 22:01:53
roundhouse: enable ScopedTypeVariables and change the signature of f to "f :: forall m. (Monad m) => m ()"
roundhouse 2017-03-04 22:03:51
cocreature: Thank you, I'll have to read up on that extension
spatial 2017-03-04 22:05:45
Should that be split into two ?
roundhouse 2017-03-04 22:06:46
cocreature: Exactly what I was looking for :)
spatial 2017-03-04 22:35:35
Should I split putmutablearray = do { arr <- newArray (512,512) 0 ; storearray "value-table" arr } into two ?
spatial 2017-03-04 22:36:46
The idea is to store an array using the State Monad. And read and write.
spatial 2017-03-04 22:39:51
Can I see an example that correctly does what I am doing http://pastebin.com/mQcJJ4f5?