Skip to content

First code example doesn't even work #87

Open
@Macil

Description

@Macil

(Apologies if this is the wrong repo entirely. I scoured the Haskell website for any "report a bug" links but couldn't find any.)

  1. I browse to https://www.haskell.org/
  2. At the top right it shows me an example of some nice "Declarative, statically typed code" which really does look pretty nice.
primes = sieve [2..] 
  where sieve (p:xs) = 
          p : sieve [x | x <- xs, x `mod` p /= 0]
  1. I notice a "Try it" section. I decide to play around with that very first example:
Type Haskell expressions in here.
λ prime = sieve [2..]
<hint>:1:7: parse error on input `='
λ  

Huh, maybe it tries to interpret each line individually. What if I do it all on one line?

λ primes = sieve [2..] where sieve (p:xs) = p : sieve [x | x <- xs, x `mod` p /= 0]
<hint>:1:8: parse error on input `='
λ  

My first impression is that I'll come back in a few years when Haskell is less buggy.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions