Haskell is love, every other language seems primitive in comparison
Jackson Perez
Doesnt C++ have metaprogramming?
Xavier Wood
What are you talking about? Everybody knows that forced generals that get posted despite the poster not having a specific topic in mind, that eventually (or immediately) degenerate into repeating the same low quality shitposts over and over and blogposting, are the future. I love generals! I hope that one day all of Jow Forums follows the path of high quality boards like /mu/ and Jow Forums.
Ethan Harris
>high quality boards like /mu/ and Jow Forums
Oliver Carter
user, he was obviously being sarcastic.
Adrian Flores
learn you a Haskell is awesome !! Thanks user
Christian Scott
the homoiconicity/bracket clutter is the best part about lisps. I still prefer haskell too though.
Jeremiah Bailey
the bracket clutter makes it nice to write a compiler for, but shit to write code in.
Haskell & related are so much more ergonomic
Xavier Foster
For anyone actually writing haskell - have you given the GHCID workflow a spin?
it's incredible for hole-driven development, and about 10 times faster feedback loop than compilation.
in short, GHCID runs your code in interpreted mode and spits out compiler messages if there are any. it autoruns when you save a file, so you can really easily see type errors and typed hole messages.
it also has a new feature behind the --allow-eval flag where you can start a comment with `-- $> ` and pass what follows into GHCI - so you can directly ask for the types & kinds, or use :info to see what instances something has
Juan Adams
I'm trying to learn Haskell from an OCaml background. Still confused about how hard to read Haskell is, with pointfree style, operators and typeclasses everywhere.
I've been trying several times but can't become productive enough with it to continue using it. I didn't have this problem with Clojure, even though I stopped because dynamic shit.
I feel like Haskell has potential and I would really like to understand it at a higher level, but past Functor and Monad it becomes harder (still can't understand Applicative's uses very well). Any advice ?
Question 2 : is the choice between Coq and Agda only related to your background with OCaml and Haskell, or are there other significant differences ?
Jordan Collins
How to read Pointfree:
1) for simple pointfree, you can just add an argument, so
myFunction = func1 . func2
becomes
myFunction a = func1 . func2 $ a
2) there are pointfree patterns that can make it a bit trickier, one common pattern is to see compositions where you partially apply the compose operator and see something like:
myFunction = (someFunc .) . otherfunc
essentially this is a way to pass extra arguments into a composition chain. check out the video 'pointfree or die, tacit programming in haskell' on youtube.
there's also a tool on pointfree.io where you can see any pointful statement as a pointfree statement
but quite often, it's not necessary to write things pointfree, it's just an exercise.
when it comes to coq v. agda, I'm told that coq has a better story when it comes to use in production. - personally I think it's more about Idris vs coq.
Jordan Martin
I tried haskell-ide-engine right after watching nmitchell's talk. Then I gave a quick try to ghcide and many features supported by coc.nvim failed in ghcide, so I went back to haskell-ide-engine. Might give it another try as development advances (it's still too new)
Brandon Flores
Applicative is a functor but you can map over two functors rather than one with lifta2, the result being the effects of the two functors are sequenced.
Liam Rivera
basically this, it let's you thread a functor of functions with a functor, for example this code (,) many digit many char [\code] combines a multiple digit parser with a multiple character parser ( is a synonym for fmap)
Xavier Howard
GHCID isn't really meant for editor integration, you just run it side by side with your editor
Anthony Green
Applicative is a bit funky because it primarily solves 2 problems that don't exist outside of haskell/hardcore FP
1. I need to map a curried function over two items inside of functors, but the function gets stuck inside of a functor and It's annoying to get it back out to map over the next thing.
or
2. I need to do something monad-like with my context, but what I need to do would break the monad laws. (applicative can implicate sequential dependant execution while breaking the requirement of identity on monads. See the Validation functor - it keeps a list of all the errors instead of returning the first one like an Either)
Colton Powell
I prefer "A Gentle Introduction to Haskell" though.
Gavin Hughes
Subjective opinion. I think parens are quite nice.
Hunter Moore
literally just use a threading macro and you've eliminated 90% of paren hell situations
Ian Diaz
Emacs
Lincoln Hernandez
Somewhat brainlet having a hard time wrapping head around advanced C.
Haskell sounds interesting, am I too retard?
If not, what's a nice resource for semi-retards to learn Haskell?
Thomas Reyes
No, there is absolutely no sarcasm in this board, he was being deadly serious.
Zachary Davis
Lisp macros are a superior way of metaprogramming than Template Haskell. I prefer Haskell in general tho.
Not having anything specific in my head (you will find good guides), just one tip: dont waste to much time on books and tutorials. Do some minimal amount of reading, but then do some small project yourself and learn the concepts you need as they come up (how to do IO, how to generate random numbers, how to work with arrays, ...)
Adam Thompson
>Do some minimal amount of reading, but then do some small project yourself This is a programming thread, not a coding thread.
Aiden Robinson
Why do only functional languages use hindley milner? Why aren't there any mainstream imperative languages that use it?
Jacob Johnson
Um >currying and whatnot
Josiah Morgan
Which language do I start with?
Henry Walker
COBOL.
Samuel Taylor
The type system requirements for hindly milner does depend on there being no mutation and referential transparency. Language features like this/self break referential transparency.
Thomas Kelly
Why did it take so long for Haskell's Applicative to get introduced? I feel like that should've been obvious from the start (Then again, I have a lisp background).
Jeremiah Nguyen
Because hindley milner is a lambda calculus? Also like says mutation introduces inconsistency, see the ocaml value restriction.
William Edwards
What the fuck is a "meta language"?
Elijah Ward
I believe the term is "point free."
Colton Russell
What languages do you already know? What are your goals?
Oh sorry I thought you meant ghcide, by the same author.
Caleb Rivera
>/mlg/
Daniel Ross
Languages that descent from SML (Standard Meta Language). Namely the languages listed in OP.
BAhahahaha
The paper on applicative is quite recent. In short, nobody thought it was useful. Then it took a long time to have the language changed such that applicative was a prerequisite to monad.
This is why monad has 'return'. Which does the exact same thing as "pure' on applicative.
Purescript doesn't have this issue
Aaron Long
I already love a non-employable language (Lisp), I would prefer to learn more job-oriented things now.
Blake Lopez
There are honestly not that many applicatives that aren't monads. Hell, the only ones I know of are `Validation`, `ZipList`, free applicatives, and some variants of `Lan`.
People got by using monads, and haven't seen the need for `Applicative` until recently. Also, keep in mind that the Haskell ecosystem was very stagnant until Haskell 2010, at which point it took up serious steam.
Anthony Roberts
Oh, and `Const`.
Isaac Stewart
I'm an imperative programmer by trade (slew of C-style syntax languages), and ever since i started learning racket ive begun to annoy my colleagues by writing superior, more maintainable code eg using declarative transformations & immutability, localizing state as a priority. I'm interested in haskell but i fear being being hand-tied and unable to practice newly learned wisdoms. I also am finding it harder to mentally track complex interactions involving a lot of state, eg unwieldy for loops. I suspect its because there is a voice in my head saying "this is stupid, why isn't this a few maps and a reduce instead of this half-screen monstrosity" - so i mentally check out due to the emotional "fuck it not my mess".
Dominic Garcia
So you kind of agree with me then? It feels bad learning all these things to never be able to put them in practice, at your workplace.
Jeremiah Lopez
Yeah, i agree, somewhat. I still want to learn haskell/ML since ive had a lot of joy from racket, and it has made me a better programmer anyway, but hasn't really increased my job satisfaction or remuneration at all. I guess as a side effect i have a deeper understanding of SQL, which does help job wise.
Jacob Evans
>ive begun to annoy my colleagues by writing superior, more maintainable code why the fuck would you be paid to work in a language your coworkers aren't using
Christopher Ramirez
I know C, Javascript, PHP, Python, Ruby, etc.
To understand functional programming and programming in general.
Just want to know which language I should start with if I want to get into functional.
(Have a book on HOPE tho I haven't read it)
Tyler James
>I also am finding it harder to mentally track complex interactions involving a lot of state, eg unwieldy for loops. I suspect its because there is a voice in my head saying "this is stupid, why isn't this a few maps and a reduce instead of this half-screen monstrosity" - so i mentally check out due to the emotional "fuck it not my mess". I'm picturing you as this guy right now
SQL, really? I thought data bases and lambda calculus, et al didn't have much in common
Noah Thompson
I dont know lambda calculus (only done a few small projects in racket) however coming back to SQL from racket has increased my appreciation for declarative set-based logic, eg made it easier for me to mentally break down an sqlish problem into a series of obvious data transformations and aggregations. I'm also finding it easier to read sql and other non-c style syntaxes and pick them up, as if getting use to s-exprs expanded a bit of my brain that was stuck always trying to put syntax in terms of C-style constructs. Maybe that's a handicap just because i'm strange, dunno if others experience it.
You misunderstand, i'm writing the same languages as them, but with a slightly modified style. And no, im not breaking coding convention or time-wide policies. I realize consistency is important.
kek
Kevin Wright
Haskell suffers a lot from legacy bloat.
Owen Adams
I'd say start with haskell, or you can learn FP in javascript then move to haskell
Matthew Cox
ghcide/hie-core is dependant on ghc versions, which makes setup a pain.
ghcid is perfect for my workflow.
I'd say SQL is declarative, just like FP languages, but one relies on relational algebra, and the other on lambda calculus.
though they might have an isomorphism, unsure.
agree, purescript really frees up a lot of legacy bloat from haskell's typesystem and makes a lot of smart choices about typeclasses being granular and building on each other, it's a good 'sequel' to haskell.
Kevin Cox
I'm not actually familiar with purescript, what do you mean about "typeclasses being granular?"
Tyler Thomas
so rather than one big Num typeclass that implements arithmetic operators, you have smaller typeclasses for semiring -> ring -> euclideanRing, etc.
ie typeclass dependancies that are actually informed by category theory,
it also solves a bunch of the issues with JS and is a pleasure to work with, while still allowing for JS interop, it also has backends for C and kotlin
Hudson Lopez
>just add an argument Why did you add an operator, too?
(a . b) c = a (b c)
f . g \x -> (f . g) x -- eta expand \x -> f (g x) -- definition of (.)
(f .) . g \x -> ((f .) . g) x -- eta \x -> (f .) (g x) -- (.) \x -> f . g x -- operator section \x -> \y -> (f . g x) y -- eta \x -> \y -> f (g x y) -- (.)
Mainstream languages fell for the subtyping meme, which is incompatible with Hindley-Milner.
Caleb Garcia
Subtying is absolutely retarded tbqh, I have no idea why it's so popular. Existentials can do everything subtypes do.
Julian Collins
Ah, that does make sense. ZipList is the main Applicative I thought of anyway. That makes sense though. Gonna check out those other Applicatives today.
Levi Turner
Check out `FunList`/`Bazaar` in particular. It's a particular free applicative functor, and has an extremely interesting relationship to `Traversable`.
Kayden Sanders
Free applicatives in general seem to be the most useful. My favorite use of them is the free applicative of Async from Control.Concurrent.Async. It being a free applicative means that you can combine multiple Asyncs together, and then wait on all of them. Being a free applicative also means that you can get analyze them by turning each Async a into a monoidal value, like [ThreadId] or IO (), meaning you can get info about what threads are involved, or cancel all of them.
awaitAll :: Ap Async a -> IO a awaitAll = runAp wait
cancelAll :: Ap Async a -> IO () cancelAll = runAp_ cancel
asyncThreadIds :: Ap Async a -> [ThreadId] asyncThreadIds = runAp_ (\a -> [asyncThreadId a])
Jack Bennett
>Not having anything specific in my head (you will find good guides), just one tip: dont waste to much time on books and tutorials. Do some minimal amount of reading, but then do some small project yourself and learn the concepts you need as they come up (how to do IO, how to generate random numbers, how to work with arrays, ...) This is actually good sound advice. Still need a decent beginners book recommendation though.
Joseph Garcia
learn you a haskell for great good if you're a cheapskate,
learn haskell from first princeples if you actually are prepared to pay money and learn the language.
Jack Rogers
>learn you a haskell for great good Is it some sekrit insiders joke that the title of that book is so retarded?
Austin White
yeah
Grayson Ward
LYAH is shit. Just tell people to pirate HPFFP. The author is an asshole anyway, so no need to lose sleep over it or anything.
Isaac Butler
got halfway through LYAH when i was like 16. it was cool i guess. later i went to colleg. then i flunked out. now im in this thresd
Lucas Hill
Is there a programming language like Haskell where you can just straight up use existential quantifiers without having to masquerade them as universal quantification in data constructors?
Jaxson Powell
How does it feel to be a failure? I've never been one, so I'd like to know.
I find writing Common Lisp in Emacs with paredit and aggressive-indent to be so ergonomic that I've yet to be able to get into Haskell, despite really wanting to use a Hindley-Milner language. I find using whitespace sensitive languages so much less pleasant. What is your editing setup like?
Aiden Ward
fp bp cringe, how are parenthesis bad? It deletes all redundancy. Haskell on the other hand is cringe unreadable garbage
Aiden Cook
>insider Isn't it in the tradition of _why's (Poignant) Guide?
Logan Jones
Is Haskell a good language to get into functional or should I try other languages like Coq or Lisp?
Camden Martinez
/thread
Matthew Murphy
Yeah, Haskell's the best way to start with proper FP. Lisp and its variants like Scheme are more multiparadigm, using procedural and (non-shit) OO programming paradigms where it happens to be useful. Haskell is a deep dive into FP everywhere.
Luke Fisher
>lisp Ahhh lisp! The first language I learned was clojure using lighttable. I love REPL's! Then I took the lisp nested syntax to javascript and I was able to think in computational space forever more. (fn x (fn x y)) it just naturally made sense to me where the C style syntax did not.
Haskell is the C++ of FP. Plus going back to a non dep-type system sucks. And please don’t bring up liquid abomination.
Dylan Robinson
Other FPLs like Idris improve over Haskell immensely but they don't have the resources, scope and community that Haskell does.
Cooper James
Yeah and they never will because lazy people like you are keeping software shit because of sunk cost.
James Ward
Haskell is so fucking good bros, I love how everything comes together
Jack Carter
doesn't change the fact that it's the best option for the uninitiated
Joshua Perry
haskell is full of legacy hacks
Andrew Murphy
Definitely doesn't feel that way, but I'm curious. What isn't?
Jonathan Moore
Nothing that has been around for longer than 2 months isn't. But just off the top of my head >non-total functions were a mistake >undefined was a mistake >exceptions were a mistake >the typeclass hierarchy and many associated functions are kind of a mess with shit like applicative messily wedged in post hoc >type system extensions are messy and inelegant
Jeremiah Phillips
> meta language general > no LISP
alright boys. wrap it up. we've got a massive brainlet on our hands.
>>non-total functions were a mistake sure, but that's in issue with Prelude and not Haskell >>undefined was a mistake Completely disagree on that one. It's an amazing tool for designing your program and making sure your types align before writing all of the logic. >>exceptions were a mistake see my stance on non-total functions >>the typeclass hierarchy and many associated functions are kind of a mess with shit like applicative messily wedged in post hoc I kind of agree on this one. The pure/return thing is annoying. >>type system extensions are messy and inelegant can't comment on this because I haven't messed with them enough
Joseph Cox
Javascripts lodash or underscore
Christian Carter
> Where to learn PureScript Why would you learn PureScript when you can just use incr_dom? github.com/janestreet/incr_dom
Austin Wood
How does programming in haskell 2nd edition compare to learn you a haskell? They're pushing that book but I prefer pirating/free shit.