fork download
  1. data ExampleType = TypeA (Int, Int) | TypeB (Int, Int, Int)
  2.  
  3. exampleFunction :: ExampleType -> Int
  4. exampleFunction (TypeA (a,b)) = a + b
  5. exampleFunction (TypeB (a,b,c)) = a + c + c
  6.  
  7.  
  8. main = print $ exampleFunction (TypeA (2,3))
Success #stdin #stdout 0s 4696KB
stdin
Standard input is empty
stdout
5