mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 04:09:10 +03:00
removed trailing whitespace (#955)
This commit is contained in:
parent
68eecce0f4
commit
fb08004041
@ -24,4 +24,3 @@ doSort (S k) = do let xs = sort $ randishInts 12000 $ natToInteger k
|
||||
main : IO ()
|
||||
main = do max <- getLine
|
||||
doSort (integerToNat (cast max))
|
||||
|
||||
|
@ -38,4 +38,3 @@ modifyIORef : HasIO io => IORef a -> (a -> a) -> io ()
|
||||
modifyIORef ref f
|
||||
= do val <- readIORef ref
|
||||
writeIORef ref (f val)
|
||||
|
||||
|
@ -32,4 +32,3 @@ public export %inline
|
||||
setField : {s : _} -> Struct s fs -> (n : String) ->
|
||||
{auto fieldok : FieldType n ty fs} -> ty -> IO ()
|
||||
setField s n val = primIO (prim__setField s n fieldok val)
|
||||
|
||||
|
@ -33,5 +33,3 @@ repl : HasIO io =>
|
||||
(prompt : String) -> (onInput : String -> String) -> io ()
|
||||
repl prompt fn
|
||||
= replWith () prompt (\x, s => Just (fn s, ()))
|
||||
|
||||
|
||||
|
@ -18,4 +18,3 @@ public export
|
||||
||| Right-to-left monadic bind, flipped version of `>>=`.
|
||||
(=<<) : Monad m => (a -> m b) -> m a -> m b
|
||||
(=<<) = flip (>>=)
|
||||
|
||||
|
@ -170,4 +170,3 @@ lazyFilterRec pred (x :: xs) with (pred x)
|
||||
rewrite appendAssociative (reverse revSkipped) [y] (z :: zs) in
|
||||
rewrite sym (reverseOntoSpec [y] revSkipped) in
|
||||
filterHelper (y :: revSkipped) (z :: zs)
|
||||
|
||||
|
@ -380,4 +380,3 @@ DivisionTheoremUniqueness numer denom denom_nz q r x prf =
|
||||
rewrite sym $ sndDivmodNatNZeqMod numer denom denom_nz denom_nz in
|
||||
rewrite DivisionTheoremUniquenessDivMod numer denom denom_nz q r x prf in
|
||||
(Refl, Refl)
|
||||
|
||||
|
@ -14,4 +14,3 @@ multRightCancel (S a) 0 r@(S predr) r_nz ar_eq_br impossible
|
||||
multRightCancel (S a) (S b) r@(S predr) r_nz ar_eq_br =
|
||||
cong S $ multRightCancel a b r r_nz
|
||||
$ plusLeftCancel r (a*r) (b*r) ar_eq_br
|
||||
|
||||
|
@ -208,4 +208,3 @@ lexTo : (TokenData a -> Bool) ->
|
||||
lexTo pred tmap str
|
||||
= let (ts, (l, c, str')) = tokenise pred 0 0 [] tmap (fastUnpack str) in
|
||||
(ts, (l, c, pack str'))
|
||||
|
||||
|
@ -211,5 +211,3 @@ Ord a => Ord b => Ord (a, b) where
|
||||
compare (x1, y1) (x2, y2)
|
||||
= if x1 /= x2 then compare x1 x2
|
||||
else compare y1 y2
|
||||
|
||||
|
||||
|
@ -25,4 +25,3 @@ infixr 9 .
|
||||
infixr 0 $
|
||||
|
||||
infixl 9 `div`, `mod`
|
||||
|
||||
|
@ -36,4 +36,3 @@ Uninhabited (True = False) where
|
||||
public export
|
||||
Uninhabited (False = True) where
|
||||
uninhabited Refl impossible
|
||||
|
||||
|
@ -52,6 +52,3 @@ main : IO ()
|
||||
main = do putStr "Enter a number: "
|
||||
x <- getLine
|
||||
printLn (interp [] fact (cast x))
|
||||
|
||||
|
||||
|
||||
|
@ -37,4 +37,3 @@ Show a => Show (Vect n a) where
|
||||
show' Nil = ""
|
||||
show' (x :: Nil) = show x
|
||||
show' (x :: xs) = show x ++ ", " ++ show' xs
|
||||
|
||||
|
@ -44,4 +44,3 @@ natToBin Z = Nil
|
||||
natToBin k with (parity k)
|
||||
natToBin (j + j) | Even = False :: natToBin j
|
||||
natToBin (S (j + j)) | Odd = True :: natToBin j
|
||||
|
||||
|
@ -14,4 +14,3 @@ plus_ind n m
|
||||
(\k, k_rec => S k_rec) -- Inductive step plus_ind (S k) m
|
||||
-- where k_rec = plus_ind k m
|
||||
n
|
||||
|
||||
|
@ -1,4 +1,2 @@
|
||||
plus_commutes : (n, m : Nat) -> plus n m = plus m n
|
||||
plus_assoc : (n, m, p : Nat) -> plus n (plus m p) = plus (plus n m) p
|
||||
|
||||
|
||||
|
@ -188,4 +188,3 @@ piBindNames loc env tm
|
||||
piBind [] ty = ty
|
||||
piBind (n :: ns) ty
|
||||
= IPi loc erased Implicit (Just (UN n)) (Implicit loc False) (piBind ns ty)
|
||||
|
||||
|
@ -45,4 +45,3 @@ checkDot rig elabinfo nest env fc reason tm (Just gexpty)
|
||||
pure (metaval, gexpty)
|
||||
_ => throw (GenericMsg fc ("Dot pattern not valid here (Not LHS) "
|
||||
++ show tm))
|
||||
|
||||
|
@ -27,4 +27,3 @@ checkPrim fc StringType = (PrimVal fc StringType, TType fc)
|
||||
checkPrim fc CharType = (PrimVal fc CharType, TType fc)
|
||||
checkPrim fc DoubleType = (PrimVal fc DoubleType, TType fc)
|
||||
checkPrim fc WorldType = (PrimVal fc WorldType, TType fc)
|
||||
|
||||
|
@ -49,4 +49,3 @@ fromOctChars = fromOctChars' 1
|
||||
export
|
||||
fromOct : String -> Maybe Int
|
||||
fromOct = fromOctChars . unpack
|
||||
|
||||
|
1082
src/Utils/Path.idr
1082
src/Utils/Path.idr
File diff suppressed because it is too large
Load Diff
@ -61,4 +61,3 @@ main
|
||||
-- | Left err => do putStrLn "Buffer read fail"
|
||||
-- closeFile f
|
||||
-- closeFile f
|
||||
|
||||
|
@ -29,4 +29,3 @@ main = do printLn (foo Nat)
|
||||
printLn (foo (List Int))
|
||||
printLn (strangeId 42)
|
||||
printLn (strangeId (the Int 42))
|
||||
|
||||
|
@ -12,4 +12,3 @@ main = do Right () <- createDir "testdir"
|
||||
printLn ok
|
||||
writeFile "test.txt" "hello\n"
|
||||
printLn !currentDir
|
||||
|
||||
|
@ -40,4 +40,3 @@ main
|
||||
printLn (the Bits16 (fromInteger (-1)))
|
||||
printLn (the Bits32 (fromInteger (-1)))
|
||||
printLn (the Bits64 (fromInteger (-1)))
|
||||
|
||||
|
@ -46,4 +46,3 @@ mLetBind x y
|
||||
= do let Just res = maybeAdd x y
|
||||
| Nothing => Just Z
|
||||
Just res
|
||||
|
||||
|
@ -24,4 +24,3 @@ namespace Set
|
||||
|
||||
keepUnique : List b -> List b
|
||||
keepUnique {b} xs = toList (fromList xs)
|
||||
|
||||
|
@ -100,4 +100,3 @@ public export
|
||||
data Dec : Type -> Type where
|
||||
Yes : a -> Dec a
|
||||
No : (a -> Void) -> Dec a
|
||||
|
||||
|
@ -1,3 +1,2 @@
|
||||
foo : Int -> Int -> Int
|
||||
foo x x = x + x
|
||||
|
||||
|
@ -32,4 +32,3 @@ foo = 3
|
||||
|
||||
bar : Fin 5
|
||||
bar = 8
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
foo : (x : Nat) -> case x of
|
||||
Z => Nat -> Nat
|
||||
S k => Nat
|
||||
|
||||
|
@ -46,4 +46,3 @@ mLetBind x y
|
||||
= do let Just res = maybeAdd x y
|
||||
| Nothing => Just Z
|
||||
Just res
|
||||
|
||||
|
@ -17,4 +17,3 @@ len : forall xs . Env xs -> Nat
|
||||
-- neither of these are fine
|
||||
len': Env xs -> Nat
|
||||
append' : Vect n a -> Vect m a -> Vect (n + m) a
|
||||
|
||||
|
@ -2,4 +2,3 @@ import Data.Vect
|
||||
|
||||
dvec : (n : Nat) -> {default (replicate n 1) xs : Vect n Nat} -> Nat
|
||||
dvec n = foldr (+) Z xs
|
||||
|
||||
|
@ -19,4 +19,3 @@ lookup (FS k) (x :: xs) = lookup k xs
|
||||
zip : Vect n a -> Vect n b -> Vect n (a, b)
|
||||
zip [] [] = []
|
||||
zip (x :: xs) (y :: ys) = (x, y) :: zip xs ys
|
||||
|
||||
|
@ -21,4 +21,3 @@ Eq Foo where
|
||||
|
||||
test2 : String
|
||||
test2 = showIfEq MkFoo MkBar
|
||||
|
||||
|
@ -8,5 +8,3 @@ main : IO ()
|
||||
main = printLn $ T == T
|
||||
|
||||
%default covering
|
||||
|
||||
|
||||
|
@ -7,4 +7,3 @@ public export
|
||||
plus : Nat -> Nat -> Nat
|
||||
plus Z y = y
|
||||
plus (S k) y = S (plus k y)
|
||||
|
||||
|
@ -4,4 +4,3 @@ import Mult
|
||||
|
||||
thing : Nat -> Nat
|
||||
thing x = mult x (plus x x)
|
||||
|
||||
|
@ -7,4 +7,3 @@ public export
|
||||
plus : Nat -> Nat -> Nat
|
||||
plus Z y = y
|
||||
plus (S k) y = S (plus k y)
|
||||
|
||||
|
@ -4,4 +4,3 @@ import Mult
|
||||
|
||||
thing : Nat -> Nat
|
||||
thing x = mult x (plus x x)
|
||||
|
||||
|
@ -2,4 +2,3 @@ module A
|
||||
|
||||
public export
|
||||
defA : Int -> Int
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
module B
|
||||
|
||||
import A
|
||||
|
||||
|
@ -16,4 +16,3 @@ suc x y prf = ?quux
|
||||
|
||||
suc' : x = y -> S x = S y
|
||||
suc' {x} {y} prf = ?quuz
|
||||
|
||||
|
@ -9,4 +9,3 @@ append xs ys
|
||||
= case xs of
|
||||
[] => ?bar_3
|
||||
(x :: zs) => ?bar_4
|
||||
|
||||
|
@ -8,4 +8,3 @@ dupAll : Vect n a -> Vect n (a, a)
|
||||
dupAll xs = zipHere xs xs
|
||||
where
|
||||
zipHere : forall n . Vect n a -> Vect n b -> Vect n (a, b)
|
||||
|
||||
|
@ -110,4 +110,3 @@ public export
|
||||
data Dec : Type -> Type where
|
||||
Yes : a -> Dec a
|
||||
No : (a -> Void) -> Dec a
|
||||
|
||||
|
@ -18,4 +18,3 @@ Functor (Test c d) where
|
||||
-- renamed)
|
||||
Functor (Test a b) where
|
||||
map = ?bar
|
||||
|
||||
|
@ -17,4 +17,3 @@ interface BadFinite t where
|
||||
implementation BadFinite (Fin k) where
|
||||
badcard = k
|
||||
badto = id
|
||||
|
||||
|
@ -6,4 +6,3 @@ interface Foo m where
|
||||
-- clash, so one has to be renamed.
|
||||
Eq k => Foo (\s, t => List (s, t)) where
|
||||
bar x y z = ?bang
|
||||
|
||||
|
@ -4,4 +4,3 @@ interface Monad m => FooBar m where
|
||||
Foo : {0 a : Type} -> a -> m a -> Type
|
||||
Bar : {0 A : Type} -> m A -> Type
|
||||
foo : {0 A : Type} -> (x : A) -> (ma : m A) -> Foo x ma -> Bar ma
|
||||
|
||||
|
@ -5,4 +5,3 @@ interface Monad m => FooBar m where
|
||||
Foo : {A : Type} -> A -> m A -> Type
|
||||
bar : {A : Type} -> (ma : m A) -> m (DPair A (\ a => Foo a ma))
|
||||
foobar : {A : Type} -> (ma : m A) -> map DPair.fst (bar ma) = ma
|
||||
|
||||
|
@ -19,4 +19,3 @@ data Nat = Z | S Nat
|
||||
take : Nat -> Stream a -> List a
|
||||
take Z xs = Nil
|
||||
take (S k) (x :: xs) = List.(::) x (take k xs)
|
||||
|
||||
|
@ -41,4 +41,3 @@ doorProg
|
||||
| Left d => deleteDoor d
|
||||
d <- closeDoor d
|
||||
deleteDoor d
|
||||
|
||||
|
@ -40,4 +40,3 @@ doorProg
|
||||
Right d' <- openDoor d
|
||||
| Left d => deleteDoor d
|
||||
?foo
|
||||
|
||||
|
@ -45,4 +45,3 @@ holetest1 x y = plus ?this y
|
||||
|
||||
holetest2 : (1 x : Nat) -> (1 y : Nat) -> Nat
|
||||
holetest2 x y = plus x ?that
|
||||
|
||||
|
@ -11,4 +11,3 @@ baz = test foo -- fine!
|
||||
|
||||
bar : Nat
|
||||
bar = test foo -- bad!
|
||||
|
||||
|
@ -15,4 +15,3 @@ test bytes_list = do
|
||||
let int9 = (index 12 bytes_list * 8) + (index 13 bytes_list * 4) + (index 14 bytes_list * 2) + (index 15 bytes_list)
|
||||
let int10 = (index 12 bytes_list * 8) + (index 13 bytes_list * 4) + (index 14 bytes_list * 2) + (index 15 bytes_list)
|
||||
pure int1
|
||||
|
||||
|
@ -28,4 +28,3 @@ eqBigs = Refl
|
||||
|
||||
eqBigs' : bigEx' 800000 = bigEx' 800000
|
||||
eqBigs' = Refl
|
||||
|
||||
|
@ -27,4 +27,3 @@ testDVect = MkDVect 94 [1,2,3,4,5]
|
||||
|
||||
testPerson : Person
|
||||
testPerson = MkPerson "Wowbagger" 1337 10 (\x => S x)
|
||||
|
||||
|
@ -30,4 +30,3 @@ c = MkFlexiString "hello"
|
||||
|
||||
d : FlexiString {k = ASCII}
|
||||
d = MkFlexiString ['h', 'i']
|
||||
|
||||
|
@ -14,4 +14,3 @@ mfunc fn g (ma, mb)
|
||||
|
||||
func2 : (a -> c) -> (b -> d) -> a -> b -> (c, d)
|
||||
func2 f g a b = MkPair (f a) (g b)
|
||||
|
||||
|
@ -25,4 +25,3 @@ segfaults = Fix (Lam (Var (count 0)))
|
||||
cycleDetected : {len : _} -> {ctx : Vect len Typ} ->
|
||||
Term (TLam TNat TNat) ctx
|
||||
cycleDetected = Fix (Var (count 0))
|
||||
|
||||
|
@ -26,4 +26,3 @@ safeStrHead4 : (s : String) -> {pr : NonEmpty (unpack s)} -> Char
|
||||
safeStrHead4 {pr=foo} s with (unpack s)
|
||||
safeStrHead4 {pr=bar} s | [] = absurd bar
|
||||
safeStrHead4 s | (c::_) = c
|
||||
|
||||
|
@ -29,4 +29,3 @@ main = do printLn (foo Nat)
|
||||
printLn (foo (List Int))
|
||||
printLn (strangeId 42)
|
||||
printLn (strangeId (the Int 42))
|
||||
|
||||
|
@ -12,4 +12,3 @@ main = do Right () <- createDir "testdir"
|
||||
printLn ok
|
||||
writeFile "test.txt" "hello\n"
|
||||
printLn !currentDir
|
||||
|
||||
|
@ -40,4 +40,3 @@ main
|
||||
printLn (the Bits16 (fromInteger (-1)))
|
||||
printLn (the Bits32 (fromInteger (-1)))
|
||||
printLn (the Bits64 (fromInteger (-1)))
|
||||
|
||||
|
@ -2,5 +2,3 @@ module Main
|
||||
|
||||
main : IO ()
|
||||
main = putStrLn ?greeting
|
||||
|
||||
|
||||
|
@ -5,4 +5,3 @@ import Partial
|
||||
import Reverse
|
||||
import AveMain
|
||||
import Let_Where
|
||||
|
||||
|
@ -5,4 +5,3 @@ import Vectors
|
||||
import WordLength
|
||||
import WordLength_vec
|
||||
import XOR
|
||||
|
||||
|
@ -3,4 +3,3 @@ printLength = putStr "Input string: " >>= \_ =>
|
||||
getLine >>= \input =>
|
||||
let len = length input in
|
||||
putStrLn (show len)
|
||||
|
||||
|
@ -11,5 +11,3 @@ checkEqNat (S k) Z = Nothing
|
||||
checkEqNat (S k) (S j) = case checkEqNat k j of
|
||||
Nothing => Nothing
|
||||
Just eq => Just (sameS _ _ eq)
|
||||
|
||||
|
||||
|
@ -14,5 +14,3 @@ area : Shape -> Double
|
||||
area (Triangle base height) = 0.5 * rectangle_area base height
|
||||
area (Rectangle length height) = rectangle_area length height
|
||||
area (Circle radius) = pi * radius * radius
|
||||
|
||||
|
||||
|
@ -26,5 +26,3 @@ area : Shape -> Double
|
||||
area (Triangle base height) = 0.5 * rectangle_area base height
|
||||
area (Rectangle length height) = rectangle_area length height
|
||||
area (Circle radius) = pi * radius * radius
|
||||
|
||||
|
||||
|
@ -21,4 +21,3 @@ filterKeys test input with (storeView input)
|
||||
= if test value
|
||||
then key :: filterKeys test store | rec
|
||||
else filterKeys test store | rec
|
||||
|
||||
|
@ -24,5 +24,3 @@ data Command : Schema -> Type where
|
||||
Add : SchemaType schema -> Command schema
|
||||
Get : Integer -> Command schema
|
||||
Quit : Command schema
|
||||
|
||||
|
||||
|
@ -7,4 +7,3 @@ record Album where
|
||||
constructor MkAlbum
|
||||
title : String
|
||||
tracks : List String
|
||||
|
||||
|
@ -3,4 +3,3 @@ import Control.Monad.State
|
||||
increment : Nat -> State Nat ()
|
||||
increment inc = do current <- get
|
||||
put (current + inc)
|
||||
|
||||
|
@ -21,4 +21,3 @@ treeLabelWith lbls (Node left val right)
|
||||
|
||||
treeLabel : Tree a -> Tree (Integer, a)
|
||||
treeLabel tree = snd (treeLabelWith [1..] tree)
|
||||
|
||||
|
@ -23,4 +23,3 @@ treeLabelWith (Node left val right)
|
||||
|
||||
treeLabel : Tree a -> Tree (Integer, a)
|
||||
treeLabel tree = evalState [1..] (treeLabelWith tree)
|
||||
|
||||
|
@ -57,4 +57,3 @@ treeLabelWith (Node left val right)
|
||||
|
||||
treeLabel : Tree a -> Tree (Integer, a)
|
||||
treeLabel tree = fst (runState (treeLabelWith tree) [1..])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user