Import hs-plugins cvs
This commit is contained in:
14
examples/typecase/000/Main.hs
Normal file
14
examples/typecase/000/Main.hs
Normal file
@ -0,0 +1,14 @@
|
||||
import AltData
|
||||
import Data.Char
|
||||
|
||||
main = putStrLn f
|
||||
|
||||
f = let v = toDyn (7 :: Int)
|
||||
in typecase (v) [
|
||||
_Bool --> \(b::Bool) -> show (not b)++" :: Bool",
|
||||
_Char --> \(c::Char) -> show (toUpper c)++" :: Char",
|
||||
_Int --> \(i::Int) -> show (-i)++" :: Int",
|
||||
_String --> \(s::String) -> show (reverse s)++" :: [Char]",
|
||||
_IntToInt --> \(f::Int->Int) -> show (f 7) ++":: Int -> Int"
|
||||
] ("couldn't find a typing")
|
||||
|
2
examples/typecase/000/Makefile
Normal file
2
examples/typecase/000/Makefile
Normal file
@ -0,0 +1,2 @@
|
||||
TOP=../../..
|
||||
include ../../eval.mk
|
1
examples/typecase/000/expected
Normal file
1
examples/typecase/000/expected
Normal file
@ -0,0 +1 @@
|
||||
-7 :: Int
|
Reference in New Issue
Block a user