Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Iceland_jack
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
31.
▲
by
Iceland_jack
4y ago
The feature is not called currying but partial application, it is very nice and intuitive.
32.
▲
by
Iceland_jack
4y ago
Y combinator in Haskell fix :: (a -> a) -> a fix f = f (fix f) Y combinator (with sharing) -- https://hackage.haskell.org/package/base/docs/Data-Function.html#v:fix -- https://sta
33.
▲
by
Iceland_jack
4y ago
I didn't take it as aggressive. I hope people who are curious get something out of my comment but without intimidating others, perhaps I write it as a bonus that people can ignore if it doesn't help but you are right that some peo
34.
▲
by
Iceland_jack
4y ago
Most people require several attempts before they get over the hump
35.
▲
by
Iceland_jack
4y ago
Not critiquing, I was giving a stream of consciousness while reading. I enjoyed it Until we get Type by default the best we can do is enable NoStarIsType
36.
▲
by
Iceland_jack
4y ago
Instead of defining append_ for structure newtype Structure = Structure String append_ :: Structure -> Structure -> Structure append_ (Structure c1) (Structure c2) = Structure (c1 <> c2) empty_ :: Structure empty_
37.
▲
by
Iceland_jack
4y ago
Oh this looks fun getStructureString and render can be defined as record selectors newtype Structure = Structure { getStructureString :: String } newtype Html = Html { render :: String } BlockArguments let you
38.
▲
by
Iceland_jack
4y ago
It is possible to derive Applicative. The next release of GHC is able to derive Applicative for product types: `deriving Applicative via Generically1 F`. If you have a sum type you can derive Applicative as well, but as you mention there ar
39.
▲
by
Iceland_jack
5y ago
And `ScopedTypeVariables` is infamous for not being suggested
40.
▲
by
Iceland_jack
5y ago
> Without having already done the classes you did, it would be very difficult to motivate category theory The usual approach of teaching category theory is motivated where examples motivate the categorical gadgets, I think the unmotivate
41.
▲
by
Iceland_jack
6y ago
https://www.reddit.com/r/haskell/comments/eoo16m/base_catego...
42.
▲
by
Iceland_jack
6y ago
I was asking myself if I was destined to write for-loops for the unforseen future. Echoing Edward Kmett, "Haskell is the reason I am still a programmer today." https://www.reddit.com/r/haskell/comments&#x
43.
▲
by
Iceland_jack
6y ago
foo is not a function, it's just a value. It cannot be applied, it does not have a function type (.. -> ..)
44.
▲
by
Iceland_jack
6y ago
It comes with the territory for a fast moving language with new extensions like -XDerivingVia[1] -XLinearTypes[2], more often than not backed by a publication where its interaction with other features is considered. Some extensions are pure
45.
▲
by
Iceland_jack
6y ago
For simplicity written with a type synonym, but it cannot be partially applied. So I would use constraint synonym encoding ( https://gist.github.com/Icelandjack/5afdaa32f41adf3204ef9025... ) type FunctorOf :: foral
46.
▲
by
Iceland_jack
6y ago
Here is one way one might implement a categorical Functor ( https://www.reddit.com/r/haskell/comments/eoo16m/base_catego... ). A function S -> T maps a S(ource) type to a T(arget) type, like FunctorOf (
47.
▲
by
Iceland_jack
6y ago
It needs to be a video of SPJ to do it justice
48.
▲
by
Iceland_jack
6y ago
I wish
49.
▲
by
Iceland_jack
7y ago
Haskell?
50.
▲
by
Iceland_jack
7y ago
Haskell is definitely interesting, there is so much to explore and the community is eager
51.
▲
by
Iceland_jack
7y ago
Just learn Haskell
52.
▲
by
Iceland_jack
7y ago
> Does that tell you anything about your unconscious biases? There is so much to unpack about you here
53.
▲
by
Iceland_jack
7y ago
That's in the context of Elm, Evan gives his reasons but in the context of Haskell such multi-line equations are very common and normal Haskell style.
54.
▲
by
Iceland_jack
7y ago
It means there are two functions going between them that witness the isomorphism. The witnesses in Haskell are the higher-order functions (they transform functions) `{,un}curry`: curry :: ((a, b) -> c) -> (a -> b -> c) u
55.
▲
by
Iceland_jack
8y ago
( yes )
56.
▲
by
Iceland_jack
9y ago
GHC
57.
▲
by
Iceland_jack
10y ago
It's funny you pick that example since of natural numbers can be viewed as lists (jargon: they are both free monoids) with addition as concatenation: type Natural = [()] zero, one, two, three, four :: Natural zero = []
58.
▲
by
Iceland_jack
10y ago
That's what we attempted to remedy with `capabilities`[1] [1] https://hackage.haskell.org/package/Capabilities
59.
▲
by
Iceland_jack
10y ago
`ApplicativeDo`[1] do-notation works with Functors [1] https://downloads.haskell.org/~ghc/master/users-guide/glasgo...
60.
▲
by
Iceland_jack
11y ago
*proselytize This has annoyed me for a while now
More ›