Creating a Haskell Empty Set

Posted by mvid on Stack Overflow See other posts from Stack Overflow or by mvid
Published on 2010-06-17T20:07:54Z Indexed on 2010/06/17 20:13 UTC
Read the original article Hit count: 224

Filed under:
|

I am attempting to pass back a Node type from this function, but I get the error that empty is out of scope:

import Data.Set (Set)  
import qualified Data.Set as Set

data Node = Vertex String (Set Node)  
    deriving Show

toNode :: String -> Node  
toNode x = Vertex x empty

What am I doing wrong?

© Stack Overflow or respective owner

Related posts about haskell

Related posts about sets