Search Haskell Channel Logs

Friday, February 3, 2017

#haskell channel featuring sternmull, monochrom, lambdabot, cocreature, deech, mojjo, and 10 others.

abhiroop_ 2017-02-03 07:49:51
I was reading Gabriel Gonalez's blog on `pipes-bytestring`
abhiroop_ 2017-02-03 07:49:57
http://www.haskellforall.com/2013/09/perfect-streaming-using-pipes-bytestring.html
abhiroop_ 2017-02-03 07:50:01
In it he mentions
Forty-Bot 2017-02-03 07:50:08
ski: so I think the problem is there is no general-case fmap
abhiroop_ 2017-02-03 07:50:16
```
Forty-Bot 2017-02-03 07:50:20
only an fmap over differentiable functions
abhiroop_ 2017-02-03 07:50:30
FreeT is smart and statically enforces that we cannot read lines from the next Producer (i.e. the next line) until we finish the first line.
Forty-Bot 2017-02-03 07:50:36
which are functions of the form T a -> T a
deech 2017-02-03 07:50:45
Hi all, does anyone know if there's a way to pull an `extra-dep` in stack.yaml from Github?
Forty-Bot 2017-02-03 07:50:47
or maybe T a -> b
abhiroop_ 2017-02-03 07:52:08
So considering his example of parsing `dev/null`
abhiroop_ 2017-02-03 07:52:19
what is the buffer size that is loaded onto memory
abhiroop_ 2017-02-03 07:52:30
is that buffer size hardcoded in the library
abhiroop_ 2017-02-03 07:52:59
I understand that it takes constant space
abhiroop_ 2017-02-03 07:53:21
and the solution as mentioned in conduits is linesBounded :: MonadThrow m => Int -> Conduit Text m Text
abhiroop_ 2017-02-03 07:53:42
where we actually mention the line size exceeding which it throws an exception
abhiroop_ 2017-02-03 07:53:52
how is this size determined for pipes
ski 2017-02-03 08:00:28
Forty-Bot : hm .. can you make it into a comonad ?
ski 2017-02-03 08:00:48
(`T a -> b' made me wonder that ..)
mojjo 2017-02-03 08:08:03
hi! Anyone experienced with Aeson? I'm wondering why the following does not work:
mojjo 2017-02-03 08:08:09
(fromJust $ (decode "{\"key\":1}" :: Maybe Object)) .: "key"
aureum 2017-02-03 08:10:50
Hello, I have a Haskell function that consists of if-else statements
aureum 2017-02-03 08:11:05
I need help with iterating through a list to find a match to the input
mojjo 2017-02-03 08:11:58
aureum: sounds like 'filter' could be helpful..
aureum 2017-02-03 08:12:10
Thanks mojjo
aureum 2017-02-03 08:12:15
Let me look it up
mojjo 2017-02-03 08:13:26
filter odd [1,6,4,3,4] --> [1,3]
erisco 2017-02-03 08:18:24
I am unhappy with a library uses unsafe ops
erisco 2017-02-03 08:18:48
good 'ol unsafeInterleaveIO instead of pipes *sigh*
erisco 2017-02-03 08:19:27
I wonder if you can undo the damage
erisco 2017-02-03 08:20:38
if you're going to use unsafeInterleaveIO under the assumption foreign calls will succeed then why bother with IO at all
erisco 2017-02-03 08:21:22
either go full convenience or full safety... not this no man's land
cocreature 2017-02-03 08:21:55
mojjo: could you describe what you are trying to do with your aeson code?
sternmull 2017-02-03 08:22:28
is "Real World Haskell" a good way to quickly evaluate if haskell will be a good choice for a medium-sized project i plan? I am unexperienced in haskell but want to spend around a day or so to see if it is a valid choice for my purpose.
erisco 2017-02-03 08:22:45
in this scenario I have no issues with assuming the calls will succeed so I may as well go further and drop their IO
monochrom 2017-02-03 08:22:46
erisco: There are people who like lazy I/O :)
Clint 2017-02-03 08:22:59
sternmull: no
sternmull 2017-02-03 08:23:20
Clint: Any suggestions for a better approach?
Clint 2017-02-03 08:23:31
not offhand
erisco 2017-02-03 08:23:45
monochrom, I suppose there is still the opportunity to catch exceptions
sternmull 2017-02-03 08:24:07
Clint: What is wrong with "Real World Haskell"? Is it simply to old?
erisco 2017-02-03 08:24:10
I think oO
monochrom 2017-02-03 08:24:22
sternmull: The constant "Yes" is 70% accurate for your question. The irony is that no resource of a day is going to do better than that accuracy.
erisco 2017-02-03 08:24:44
though perhaps not... not entirely sure how exception handling works
Clint 2017-02-03 08:25:04
sternmull: it's pretty obsolete
cocreature 2017-02-03 08:25:07
pay someone who knows Haskell to talk with you for a day and let him answer the question
dolio 2017-02-03 08:25:33
'Not working' is not the only thing that could put something in IO.
erisco 2017-02-03 08:25:51
sternmull, it probably is not a good choice if you want the project done soon. Same goes for choosing any new language
monochrom 2017-02-03 08:25:55
cocreature's answer is better.
dolio 2017-02-03 08:25:56
Or even the primary thing.
erisco 2017-02-03 08:26:49
pay someone who knows Haskell to write the code :P
cocreature 2017-02-03 08:27:00
if you are interested in Haskell, by all means, give it a shot. but making an informed business decision based on 1 day of research is not possible.
monochrom 2017-02-03 08:29:06
Publish your project requirement and accept bids. From the price quotes from the bidders, you can get a feeling of how difficult this project is.
monochrom 2017-02-03 08:29:19
maybe s/accept/invite/
sternmull 2017-02-03 08:29:56
erisco: It is a hobby project, so it is okay if switching to a new language delays it or does not really work in the end. It would be nice to have async/coroutine-stuff, nice handling of child processes, TCP/TLS and other high level things. I started with Python, prototyped with Go and also consider C++. But Haskell could be a valid choice. So i want to spend one or two days to see if it fits. But i am not sure which resources to use to q
erisco 2017-02-03 08:30:59
there is also Learn You A Haskell
dolio 2017-02-03 08:31:31
Well, there are a lot of books, but most won't cover most of those topics.
erisco 2017-02-03 08:32:01
it covers zippers? lol that seems like an odd topic
monochrom 2017-02-03 08:32:32
Learn You A Haskell is just a trailer the language.
monochrom 2017-02-03 08:32:49
s/trailer/trailer of/
dolio 2017-02-03 08:33:02
Trailer?
erisco 2017-02-03 08:33:09
like a movie trailer
monochrom 2017-02-03 08:33:12
Movie trailer. Movie preview.
monochrom 2017-02-03 08:33:23
Imagine a 2-hour movie preview.
dolio 2017-02-03 08:33:30
Oh.
glguy 2017-02-03 08:33:37
That sounds like a regular movie
glguy 2017-02-03 08:33:47
or even a long movie
dolio 2017-02-03 08:34:02
Imagine if movies were a week long.
monochrom 2017-02-03 08:34:37
Yes. My analogy is that LYAH is at the depth of a trailer but the length of a full feature.
erisco 2017-02-03 08:34:38
the road map is usually something like fac, fib, lists (includes laziness), Functor, Applicative, Monad
Tuplanolla 2017-02-03 08:34:38
Well, Das Boot wanted to be...
sternmull 2017-02-03 08:35:34
it is ok if there is no perfect book (which probably isn't there). A list of essential primitives/concepts to effectively use modern haskell in real applications would probably be ok for me.
monochrom 2017-02-03 08:35:43
Maybe next time I will paint the picture of a book report longer than the book :)
erisco 2017-02-03 08:35:52
and a parser fits the bill, so that is what I'd do
erisco 2017-02-03 08:36:29
I wonder if there are any Haskell books which use parsing
monochrom 2017-02-03 08:36:33
@quote monochrom fibonacci.*nature
lambdabot 2017-02-03 08:36:33
monochrom says: the fibonacci sequence is everywhere in nature, for example haskell tutorials and python tutorials
erisco 2017-02-03 08:36:44
:D
Sonolin 2017-02-03 08:36:53
lol
monochrom 2017-02-03 08:37:13
the "write scheme in 48 hours" thing uses parsing.
erisco 2017-02-03 08:37:53
does it derive an Applicative parser or does it grab one off the shelf?
monochrom 2017-02-03 08:37:55
Several textbooks also include a monadic parsing chapter.
monochrom 2017-02-03 08:38:22
I don't know. But the several textbooks derive their own parsers.
erisco 2017-02-03 08:39:02
realistically parsing is only a good through-line if you're familiar with parsing
monochrom 2017-02-03 08:39:05
The standard simple [T] -> [(a, [T])] story. (And usually T = Char)
ski 2017-02-03 08:40:45
sternmull : .. if you don't know any functional programming language already, you can expect it to take longer and more effort to get to a point where you feel comfortable getting stuff done
erisco 2017-02-03 08:41:00
since it is a bit esoteric and you're not really going to understand all the hubbub
erisco 2017-02-03 08:42:32
monochrom, lol I remember a prof telling me, iirc, that returning an empty list on a failed parse was impressive
erisco 2017-02-03 08:43:37
supposedly that was a leap forward at one time
sternmull 2017-02-03 08:44:04
ski: I first looked at haskell around 7 years ago. Back then i was unable to understand monads and even more primitive stuff. Yesterday i read an explanation of monads and had no problem to understand it. I have an idea of what it means to use a functional language with lazy evaluation. But it would be nice to have a kick-start introduction that gives me all the toys the experienced guys play with. So i can check out if this would fit my
Tuplanolla 2017-02-03 08:44:56
It sounds like a trailer could work, sternmull.
erisco 2017-02-03 08:45:06
stop chatting and get reading! :)