[Haskell-cafe] Nice clean code example?
jeffbrown.the at gmail.com
Fri Jun 30 21:39:22 UTC 2017
Jake Brownson wrote a game of tic-tac-toe in 160 lines that I thought
was beautiful. I forked it to make it a little more readable.
On Fri, Jun 30, 2017 at 1:46 PM, Bram Neijt <bneijt at gmail.com> wrote:
> I have no idea what you consider clean. I have some ugly code that
> shows off some Haskell features:
> I think it shows off:
> - Introducing types to create a language
> - Explicit IO, allowing for clear contract exposure to the user of the
> - defaultHighlighters is a subset of defaultInputPaths through a
> simple map allowing for easily exposing constrained subsets of code
> (not data)??
> if I would force myself to continue, the number of question marks
> would just increase, so I'll stop here.
> Best of luck!
> On Fri, Jun 30, 2017 at 9:08 PM, Francesco Ariis <fa-ml at ariis.it> wrote:
> > On Fri, Jun 30, 2017 at 08:33:29PM +0200, Han Joosten wrote:
> >> I'd like to showoff some nice Haskell code to a CTO with no experience
> >> FP. I promised to send him a small piece of Haskell so he could get an
> >> idea. The code should be easy to read, without obscure looking operators
> >> (so sorry, no lens, arrows stuff like that), optionally even do
> >> interesting.
> >> Who has the nicest example laying around?
> > Some ideas:
> > - a wrongly typed piece of code: then show him a) how ghc(i) pinpoints
> > the problem part and is very clear in its demands ("I wanted this, you
> > gave me this") and b) how malleable the type system is.
> > - a declarative graph made with diagrams (with a graphical result
> > displayed)
> > - parsec (even if you go with applicative style, the code is very
> > _______________________________________________
> > Haskell-Cafe mailing list
> > To (un)subscribe, modify options or view archives go to:
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> > Only members subscribed via the mailman list are allowed to post.
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
Jeff Brown | Jeffrey Benjamin Brown
Website <https://msu.edu/~brown202/> | Facebook
<https://www.facebook.com/mejeff.younotjeff> | LinkedIn
<https://www.linkedin.com/in/jeffreybenjaminbrown>(spammy, so I often miss
messages here) | Github <https://github.com/jeffreybenjaminbrown>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe