on master help sign in
Merge pull request #670 from walkie/master
16847d5Edwin Brady
.gitignore+2
@@ -1,5 +1,7 @@
1dist
1dist
2cabal-dev/
2cabal-dev/
3+.cabal-sandbox
4+cabal.sandbox.config
3*.ibc
5*.ibc
4*.o
6*.o
5*.a
7*.a
libs/prelude/Prelude/Fin.idr+1−1
@@ -55,7 +55,7 @@ natToFin (S k) (S j) with (natToFin k j)
55natToFin _ _ = Nothing
55natToFin _ _ = Nothing
56
56
57integerToFin : Integer -> (n : Nat) -> Maybe (Fin n)
57integerToFin : Integer -> (n : Nat) -> Maybe (Fin n)
58−integerToFin x = natToFin (cast x)
58+integerToFin x n = if x >= 0 then natToFin (cast x) n else Nothing
59
59
60data IsJust : Maybe a -> Type where
60data IsJust : Maybe a -> Type where
61 ItIsJust : IsJust {a} (Just x)
61 ItIsJust : IsJust {a} (Just x)