I have a Haskell file called maxflow.hs that exports few symbols
module MaxFlow
(solveMaxFlow,MaxFlowNet,Vertex,Graph) where
import Data.List
data Vertex = Vertex {
vertexLabel :: String
, vertexNeighbors :: [(String,Int)]
, vertexDistance :: Int
, vertexPredecessor :: String
} deriving (Show)
....
In the same directory I have another file called elimination.hs that tries to use one of those symbols
import MaxFlow
g = [
Vertex "0" [("1",16), ("2",13) ] (maxBound::Int) "",
Vertex "1" [("2",10), ("3",12) ] (maxBound::Int) "",
Vertex "2" [("4",14) ,("1",4) ] (maxBound::Int) "" ,
Vertex "3" [ ("5",20), ("2",9)] (maxBound::Int) "" ,
Vertex "4" [("5",4), ("3",7) ] (maxBound::Int) "" ,
Vertex "5" [ ] (maxBound::Int) ""
]
But for some reason I can't load this file. Running :l elimination.hs
I get
elimination.hs:4:17: error:
Data constructor not in scope:
Vertex :: [Char] -> [([Char], Integer)] -> Int -> [Char] -> a
|
4 | Vertex "0" [("1",16), ("2",13) ] (maxBound::Int) "",
| ^^^^^^
I'm probably missing something very basic. Any idea ? Thanks!