« first day (663 days earlier)      last day (1203 days later) » 

12:21 AM
heyo!
 
1:07 AM
4 hours ago, by Aaron Hall
What I know about stack vs cabal is that stack is best for noobs.
I say this because I button-holed a guy who's not a supporter of stack for his day-job on the subject, and he did agree that it would be best for noobs.
 
1:21 AM
I don't mind being called a noob. Especially with Haskell, I embrace it.
 
1:31 AM
@Code-Apprentice I'm only 1/3 of the way through the official tutorial, so I'm quite a noob as well.
To provide more context, I'm a coorganizer of the Python meetup group and we (at least, I) direct new people to install Anaconda, which usually makes them immediately productive.
and I gave that same context to the guy I'm referencing who's a coorganizer of the Haskell meetup.
 
I guess I will have to check out stack
I should check out Anaconda as well
 
@Code-Apprentice theoretically you could do both at the same time: anaconda.org/conda-forge/stack
 
1:54 AM
Interesting
 
I wouldn't recommend it, to be honest... I was just trying to be clever.
 
If I do any python on windows, I will definitely check out conda
 
I use anaconda on Linux so I can do whatever whenever - and if it breaks, I just delete and reinstall.
Looks like shake is being used in stack: github.com/commercialhaskell/stack/…
although I'd figure I'd see more references to it than that...
release.hs has lots more...
ok, back to the tutorial
ping me or I'll probably miss you
 
 
1 hour later…
3:41 AM
I presume that MetaFight has taken a vow of silence on StackOverflow chat, but that he'll continue rounding out our roster in perpetuity. And, really, that's just fine by me.
 
 
9 hours later…
12:48 PM
Feb 12 at 2:17, by Aaron Hall
> fib@(0:tfib) = 0:1: zipWith (+) fib tfib
> sum $ take 1000000 fib
Killed
exit code 137...
In 'leet speak that's let, no?
I feel like I can suddenly see the matrix...
length $ take 100000000 fib
100000000
That took forever, and I got to watch all my memory get used and other stuff get pushed onto my swap...
 
1:12 PM
Kinda implemented in Python:
from itertools import tee

def fib():
    yield 0
    yield 1
    # tee required, else with two fib()'s algorithm becomes quadratic
    f, tf = tee(fib())
    next(tf)
    for a, b in zip(f, tf):
        yield a + b
 
1:56 PM
@Unihedron welcome to the room!
 
Hi! I'm trying to get better at strictly functional programming (my functional background has been mostly Scala and outside that I use java and ruby mainly) taking on haskell and elixir (maybe I'll also learn ocaml), I've been using Hackerrank's "functional programming only" problems set but it doesn't have good support for elixir (have to handle input / output) myself, anyone know of good exercise sites targetted for FP?
@AaronHall Thank you!
 
I have no idea about learning elixir. Do you know Erlang? Is that a prerequisite? I don't know.
 
I just prefer elixir because it looks like Ruby. It's built out of erlang and it's surprising how different it feels to move from erlang to elixir.
 
I'm doing one new language at a time (mostly) so I'm focusing on Haskell for now.
 
But tbh, elixir isn't really that different from haskell
I think just reading this code you might recognize pattern matching functions much like every functional language has them:
(it was for a timed tournament, so the code and parameter names aren't very pretty)
my problem with haskell is that it's too strict with formatting and "convention-guarding".
 
2:08 PM
As a Python programmer who spent some time with ruby, I just want to put out there that I hate the word, end.
Especially when it's repeated over and over...
 
Yeah, haskell does read cleaner in that regard.
 
significant whitespace is the best...
 
In ruby I avoid end by using modifier statements, like if cond end -> () if cond
 
I have no idea what that means.
 
if true then a += 1 end is the same as a += 1 if true
also for while, until, and do+end -> {}
ruby has a lot of functional components and it's really efficient coding in it, but it doesn't help me think functionally enough
Elm is another thing I want to learn (functional programming for the web!) but reading its docs makes me feel like I'm not at that level yet, gotta climb there!
 
2:20 PM
have you completed the official Haskell tutorial?
 
yes, as well as the happy learn haskell one
is this good? costs only $1 humblebundle.com/books/…
 
2:38 PM
@Unihedron I make no recommendations for anything outside of official documentation.
 
I have read the official tutorial and I helped making a scrabble game with it, but I still suck at using haskell
haha
 
@Unihedron There are ~250 builtin functions.
Do you know them?
 
next to none
 
2:57 PM
That's probably your problem.
And that's why I don't recommend anything but the documentation. If you want to make elegant use of the language as it was intended, you have to take your own notes and understand the possibility space.
 
I think exercise does wonders, which is why i prefer to grab exercises and spend some time digging for the right tools
but a lot of general problems can't be modelled functionally very well
 
3:26 PM
I don't know why you'd say that, it's (one of) my entire mental model(s) for programing.
 
 
2 hours later…
5:22 PM
@Unihedron blasphemy!
 
@Code-Apprentice rephrase: I can't model problems functionally well unless it's an easy problem
 
I had some trouble with some AoC problems that I tried to solve in Haskell. The description was given in terms of a mutable data structure like a python list or a C array. I have no idea how to do the same thing efficiently in Haskell.
I take the word choice in the description of the problem as a bias of the author towards languages with mutable structures and my own inability to translate it into the correct functional structure.
 
AoC haha... I guess if I could solve all of AoC strictly functionally, I should consider myself an expert
I think I'll have problems with most, frankly!
2016 especially
 
5:42 PM
I tried with 2017 and made it through the first 4 days using Haskell. I finally broke down and solved Days 5 and 6 with python instead.
 
I solved all of 2018 with ruby, since I was targetting the global boards, practice comes later :p
 
lurks
 
6:06 PM
@Unihedron You solved AoC 2018 already?
did you time travel?
 
sorry, 2017 :|
2017 winter is basically 2018 winter
at least, according to the way japanese television programming manages cours
 
Who knew you could do let declarations in a list comprehension?
> take 20 [(i,j) | i <- [1..], let k = i*i, j <- [1..k]]
[(1,1),(2,1),(2,2),(2,3),(2,4),(3,1),(3,2),(3,3),(3,4),(3,5),(3,6),(3,7),(3,8),(3,9),(4,1),(4,2),(4,3),(4,4),(4,5),(4,6)]
Commas are infix operators:
> (,) 1 2
(1,2)
seem to require the parens, though...
 
@AaronHall (,) is the pair constructor
parentheses included
 
> (,,,,,,,,,,) 0 1 2 3 4 5 6 7 8 9 10
(0,1,2,3,4,5,6,7,8,9,10)
 
and that's for a 10-tuple, yes
(,) : pairs :: [] : lists
 
6:21 PM
I want trailing commas to be optional.
 
then write JavaScript
 
I'm going to look into getting it into Haskell. If Python can learn from Haskell, Haskell can learn from Python.
 
7:04 PM
> take 1 $ drop 30000000 fib
[*** Exception: stack overflow
Whereas:
> take 0 $ drop 30000000000000000 fib
[]
I do believe that take 0 immediately returns []
> take 1 $ drop 300000 fib
[87617325329163457942715219<...forever>
That's a very very large number...
I should try a strict apply...
instant return with strict apply...
> take 0 $! drop 300000 fib
[]
 
7:53 PM
Looks like they're ahead of me on the trailing commas: github.com/ghc-proposals/ghc-proposals/pull/87
2
 
 
3 hours later…
10:39 PM
Anyone hanging out?
 
 
1 hour later…
11:45 PM
:thinking:
 

« first day (663 days earlier)      last day (1203 days later) »