Skip to content

Example code from README.md doesn't compile #15

Open
@JavierJF

Description

The example code showed in the README.md doesn't compile under the GHC version 7.10.3.

Give several errors as:

Couldn't match type ‘Char’ with ‘[Char]’
Expected type: [String]
Actual type: [Char]
In the second argument of ‘(:=>)’, namely ‘"hello there"’
In the expression: Baz :=> "hello there"
In the first argument of ‘fromList’, namely
‘[Foo :=> pi, Baz :=> "hello there"]’
/home/osboxes/Documents/Haskell-Workshop/app/Main.hs: 6, 19

No instance for (Num [Int]) arising from the literal ‘42’
In the second argument of ‘singleton’, namely ‘42’
In the expression: singleton Bar 42
In an equation for ‘y’: y = singleton Bar 42
/home/osboxes/Documents/Haskell-Workshop/app/Main.hs: 15, 20

Couldn't match type ‘v’ with ‘[v]’
‘v’ is a rigid type variable bound by
a type expected by the context: Foo v -> [v] -> [v] -> [v]
at app/Main.hs:15:7
Expected type: Foo v -> [v] -> [v] -> [v]
Actual type: Foo [v] -> [v] -> [v] -> [v]
In the first argument of ‘unionWithKey’, namely ‘addFoo’
In the expression: unionWithKey addFoo x z

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions