spatial 2017-02-02 21:47:38
Haskell spock is the UI framework for beginners ? I use spacemacs. Any tutorial to get started.
liste 2017-02-02 21:49:33
spatial: scotty is an easier web framework for beginners than Spock
liste 2017-02-02 21:50:09
spatial: http://adit.io/posts/2013-04-15-making-a-website-with-haskell.html
molina 2017-02-02 21:50:17
i have a bunch of functions that look the same....
molina 2017-02-02 21:50:23
what should I do
liste 2017-02-02 21:50:26
spatial: though that's a somewhat old tutorial
spatial 2017-02-02 21:50:34
Have some experience with OCaml.
molina 2017-02-02 21:50:42
i could generalize them into one function but Idk
liste 2017-02-02 21:50:50
spatial: this is more modern: https://seanhess.github.io/2015/08/19/practical-haskell-json-api.html
liste 2017-02-02 21:51:23
molina: what kind of functions?
spatial 2017-02-02 21:51:54
You mean Spock and Servant are for advanced users ?
liste 2017-02-02 21:52:02
spatial: yes, compared to Scotty
liste 2017-02-02 21:52:18
scotty doesn't use advanced type system concepts, like type families
molina 2017-02-02 21:52:50
functions that calculate the volatility of a time series and returns various aspects of the time series, like dates when the volatility is high, or the next data after a high volatility event. etc
spatial 2017-02-02 21:53:11
Intention is to use TensorFlow bindings with UI.
molina 2017-02-02 21:53:30
for speed of implementation i just modified one function into many now I have a bunch of similar looking functions.
spatial 2017-02-02 21:53:46
To start with Machine Learning projects using Haskell.
liste 2017-02-02 21:54:34
molina: do those have a common "shell", with one specific functionality different?
liste 2017-02-02 21:55:05
molina: you could extract the "shell" into one function, and pass the specifics as function arguments
molina 2017-02-02 21:55:38
yeah
Xnuk 2017-02-02 21:55:49
Can I increse indentation size when I encode data to YAML?
Xnuk 2017-02-02 21:57:31
I cannot find how to adjust indentation using Data.Yaml
liste 2017-02-02 21:58:46
> let f1 x = show ((read x :: Int) + 1); f2 x = show ((read x :: Int) * 2); f g x = show (g (read x :: Int)) in (f1 "5", f2 "5", f (+1) "5", f (*2) "5") -- molina like this
lambdabot 2017-02-02 21:58:49
("6","10","6","10")
slack1256 2017-02-02 22:12:50
how is `fmap Sum [1,2,3]` guarranted to be a no cost operation?
quchen 2017-02-02 22:15:25
It's not
slack1256 2017-02-02 22:15:45
at least will the cost be just the traversing of the list?
quchen 2017-02-02 22:16:02
Yes, that's true
slack1256 2017-02-02 22:16:35
nice, I guess that for all other cases Data.Coercible is the right answer
quchen 2017-02-02 22:17:17
Right, »coerce [1::Int,2,3] :: [Sum Int]« is a no cost operation.
slack1256 2017-02-02 22:19:47
thanks for clarifying!
quchen 2017-02-02 22:36:42
For the record, I don't think Haskell demands newtypes to be free, but it leaves the option open to implement them that way
quchen 2017-02-02 22:37:21
It requires newtypes to be unlifted, i.e. »Newtype ⊥ = ⊥«, but that's about it
quchen 2017-02-02 22:37:39
Plus some pattern matching rules