fix issue with literal type checking for strings

This commit is contained in:
Paul Chiusano 2015-03-04 14:09:02 -05:00
parent 7ceedde7fd
commit 41954bb504
2 changed files with 3 additions and 3 deletions

View File

@ -126,9 +126,9 @@ verticalCells k ifEmpty ls = let cs = List.map (\l -> L.fill bg (L.pad 5 0 l)) (
explorerCells : k -> List (Layout k) -> Layout k
explorerCells k ls =
let last l = L.fill bg (L.pad' { left = 10, right = 5, top = 6, bottom = 8 } l)
let last l = L.fill bg (L.pad' { left = 10, right = 10, top = 6, bottom = 8 } l)
col = L.leftAlignedColumn ls
fmt l = L.fill bg (L.pad' { left = 10, right = 5, top = 6, bottom = 6 } l)
fmt l = L.fill bg (L.pad' { left = 10, right = 10, top = 6, bottom = 6 } l)
cs = List.map fmt (List.take (List.length col - 1) col) ++
List.map last (List.drop (List.length col - 1) col)
in case cs of

View File

@ -70,7 +70,7 @@ checkLiteral : Literal -> T.Type -> Bool
checkLiteral lit admissible = case (lit,admissible) of
-- weird parser bug prevents use of T.Unit T.Distance as a pattern
(Distance _, T.Unit d) -> d == T.Distance
(Str _, T.Unit s) -> s == T.Distance
(Str _, T.Unit s) -> s == T.String
(Number _, T.Unit n) -> n == T.Number
(_, T.Forall n (T.Universal n')) -> if n == n' then True else False
_ -> False