Skip to content

Make more use of haskell typeclasses #2

@jtanguy

Description

@jtanguy

Instead of defining a Tree as a data, we could define it as a typeclass:

class Tree a where
    eval :: Tree -> a
    derive :: Tree -> Tree
    replace :: Tree -> a -> Tree
    clean :: Tree -> Tree

And then define leaves, unary and binary operators as instances of Tree Float

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions