kebolio 2017-01-26 06:53:42
hiya, what's the nicest http client library that isn't wreq and does http transparently? don't like lenses
c_wraith 2017-01-26 06:54:20
wreq is built on http-client, iirc
johnw 2017-01-26 06:54:53
kebolio: what's your use case?
kebolio 2017-01-26 06:59:56
johnw: in this case, for a toy web api client
kebolio 2017-01-26 07:00:05
just to get a taste of using the lang for something
sm 2017-01-26 07:01:35
how about http://hackage.haskell.org/package/download
sm 2017-01-26 07:02:10
http://hackage.haskell.org/package/req is newer but a little scarier
kebolio 2017-01-26 07:02:18
hmm
kebolio 2017-01-26 07:02:30
popping out, shall check those out later. cheers
sm 2017-01-26 07:06:52
download looks like the simple-api winner.. but is built on a bunch of c code, so less portable. https support unknown
sm 2017-01-26 07:07:45
I'm going with req
Cale 2017-01-26 07:12:00
kebolio: Recently I've just stuck to using http-client.
Cale 2017-01-26 07:13:20
You don't have to use very much of the library just to make a simple request and examine the response
biglambda 2017-01-26 07:19:02
Quick question: I need adjust a value x so that it's the nearest multiple of y to the value that is either equal to or greater than so I'm using: let adjusted x multiple = ((x + multiple - 1) `div` multiple) * multiple , is there a standard function that does this?
phadej 2017-01-26 07:21:01
> let x = 11; y = 5 in x - x `mod` y
lambdabot 2017-01-26 07:21:03
10
phadej 2017-01-26 07:21:06
would be equal or less
phadej 2017-01-26 07:21:11
and you want equal or greater?
biglambda 2017-01-26 07:21:22
Hold on :)
biglambda 2017-01-26 07:21:49
Checking
phadej 2017-01-26 07:21:50
e.g. 'ceil', not 'floor'?
phadej 2017-01-26 07:22:04
"kind of"
biglambda 2017-01-26 07:23:00
I need equal to or greater
biglambda 2017-01-26 07:23:37
I'm fitting the dimensions of an arbitrary bitmap onto tiles that are an optimum size.
glguy 2017-01-26 07:23:50
> let adjusted multiple x = x + (-x)`mod`multiple in map (adjusted 4) [1..10]
lambdabot 2017-01-26 07:23:53
[4,4,4,4,8,8,8,8,12,12]
phadej 2017-01-26 07:24:37
that seems to work?
biglambda 2017-01-26 07:24:42
let adjusted x multiple = ((x + multiple - 1) `div` multiple) * multiple
biglambda 2017-01-26 07:25:05
adjusted x multiple = ((x + multiple - 1) `div` multiple) * multiple in map (adjusted 4) [1..20]
biglambda 2017-01-26 07:25:17
let adjusted x multiple = ((x + multiple - 1) `div` multiple) * multiple in map (adjusted 4) [1..20]
glguy 2017-01-26 07:25:36
biglambda: Your example is varying the multiples, not the value being "adjusted"
biglambda 2017-01-26 07:25:56
> let adjusted x multiple = ((x + multiple - 1) `div` multiple) * multiple in map (\ x -> adjusted x 4) [1..20]
lambdabot 2017-01-26 07:25:58
[4,4,4,4,8,8,8,8,12,12,12,12,16,16,16,16,20,20,20,20]
biglambda 2017-01-26 07:26:17
Ok, it's the same result
biglambda 2017-01-26 07:26:43
Just curious if there was a standard function I was missing.
jarlg 2017-01-26 07:34:24
Is there a standard function like `whenM :: m Bool -> m () -> m ()` ? Why / why not?
niklasb 2017-01-26 07:39:20
jarlg: you could just do value >>= flip when
niklasb 2017-01-26 07:39:40
but yeah, there is such a function in MonadUtils
jarlg 2017-01-26 07:41:51
niklasb: Thanks! (I know -- mostly wondering where I should look for utils outside Control.Monad. Hoogle didn't help.)
niklasb 2017-01-26 07:42:34
well it did for me: https://www.stackage.org/lts-7.17/hoogle?q=whenM
dram_phone 2017-01-26 07:43:02
@where hoogle
lambdabot 2017-01-26 07:43:02
http://haskell.org/hoogle http://fpcomplete.com/hoogle – See also Hayoo, which searches more packages: http://hayoo.fh-wedel.de/
fragamus 2017-01-26 07:43:27
hey im having some difficulty setting up a Turtle script that is intended to monitor a directory - I want to use (ls "some dir") to generate a stream of Turtle.Filpath that works great. BUT...
jarlg 2017-01-26 07:44:32
niklasb: The haskell.org hoogle doesn't show anything... Seems stackage is more up to date. This fragmentation is confusing me..
fragamus 2017-01-26 07:45:01
I am just using view to print the stream. What I need is to open each file, and read one line from it, and do some stuff with that line