on master help sign in
Simplify export rules.

No longer have the default changing according to whether there are any access modifiers in a module.

commita14e4edea00295b6b73a2515264e88457396453a authorEdwin Brady <ecb10@st-andrews.ac.uk> dateFri 29 Jan 2016, 13:17 (11 years ago) parent6042cfe
82 files changed+223−84
CHANGELOG+12 libs/base/Control/Catchable.idr+2 libs/base/Control/IOExcept.idr+2 libs/base/Control/Isomorphism.idr+1 libs/base/Control/Monad/Identity.idr+2 libs/base/Control/Monad/Trans.idr+2 libs/base/Data/Complex.idr+2 libs/base/Data/List/Quantifiers.idr+2 libs/base/Data/So.idr+1 libs/base/Data/Vect/Quantifiers.idr+2 libs/base/Debug/Error.idr+1−1 libs/base/Debug/Trace.idr+1 libs/base/Language/Reflection/Utils.idr+2 libs/base/Syntax/PreorderReasoning.idr+2 libs/base/System/Concurrency/Raw.idr+2 libs/base/System/Info.idr+3 libs/contrib/Classes/Verified.idr+2 libs/contrib/Control/Algebra.idr+1 libs/contrib/Control/Algebra/Lattice.idr+1 libs/contrib/Control/Algebra/NumericInstances.idr+1 libs/contrib/Control/Algebra/VectorSpace.idr+2 libs/contrib/Control/Partial.idr+1−1 libs/contrib/Control/WellFounded.idr+1−1 libs/contrib/Data/Fun.idr+1 libs/contrib/Data/Matrix.idr+1 libs/contrib/Data/Matrix/Algebraic.idr+1−1 libs/contrib/Data/Matrix/Numeric.idr+1 libs/contrib/Data/Nat/DivMod.idr+1 libs/contrib/Data/Rel.idr+1 libs/contrib/Data/Sign.idr+2 libs/contrib/contrib.ipkg+2 libs/effects/Effect/Default.idr+2 libs/effects/Effect/Exception.idr+2 libs/effects/Effect/File.idr+1 libs/effects/Effect/Monad.idr+2 libs/effects/Effect/Random.idr+2 libs/effects/Effect/Select.idr+2 libs/effects/Effect/StdIO.idr+2 libs/effects/Effect/System.idr+2 libs/prelude/Decidable/Equality.idr+2 libs/prelude/Language/Reflection/Elab.idr+2 libs/prelude/Language/Reflection/Errors.idr+2 libs/prelude/Prelude/Applicative.idr+2 libs/prelude/Prelude/Basics.idr+3−1 libs/prelude/Prelude/Bool.idr+2 libs/prelude/Prelude/Cast.idr+2 libs/prelude/Prelude/Chars.idr+2 libs/prelude/Prelude/Either.idr+2 libs/prelude/Prelude/Functor.idr+2 libs/prelude/Prelude/Interfaces.idr+2 libs/prelude/Prelude/Providers.idr+2 libs/prelude/Prelude/Show.idr+2 libs/prelude/Prelude/Strings.idr+2 libs/prelude/Prelude/Traversable.idr+2 libs/prelude/Prelude/Uninhabited.idr+2 libs/pruviloj/Pruviloj/Core.idr+2 libs/pruviloj/Pruviloj/Internals.idr+2 libs/pruviloj/Pruviloj/Internals/TyConInfo.idr+1−1 libs/pruviloj/Pruviloj/Renamers.idr+2 src/Idris/Core/Evaluate.hs+3−5 src/Idris/Elab/Term.hs+3−1 src/Idris/IBC.hs+43−30 src/Idris/Parser.hs+13−14 src/Idris/REPL.hs+18−13 src/Pkg/Package.hs+1−1 test/basic009/A.idr+1 test/basic009/B/C.idr+1 test/dsl002/Resimp.idr+2 test/effects003/VectMissing.idr+1 test/idrisdoc002/TestFunctions.idr+2−1 test/idrisdoc003/TestDatatypes.idr+2−1 test/idrisdoc004/TestTypeclasses.idr+1 test/idrisdoc005/TestTracing.idr+2−1 test/idrisdoc006/A/fully/Qualified/NAME.idr+2−2 test/idrisdoc006/B.idr+2−1 test/idrisdoc009/Test.idr+2 test/literate001/Lit.lidr+2−2 test/proof002/Reflect.idr+1 test/proof002/expected+3−3 test/proof003/Parity.idr+2 test/proof003/expected+2−2 test/reg007/A.lidr+1−1
CHANGELOG+12
@@ -1,3 +1,15 @@
1+New in 0.11:
2+============
3+
4+* The export rules have been simplified. Now:
5+ - 'private' means that the definition is not exported at all
6+ - 'export' means that the top level type is exported, but not the
7+ definition. In the case of 'data', this means the type constructor is
8+ exported but not the data constructors.
9+ - 'public export' means that the entire definition is exported.
10+* By default, names are 'private'. This can be altered with an %access
11+ directive as before.
12+
113New in 0.10:
214============
315
libs/base/Control/Catchable.idr+2
@@ -2,6 +2,8 @@ module Control.Catchable
22
33import Control.IOExcept
44
5+%access public
6+
57interface Catchable (m : Type -> Type) t where
68 throw : t -> m a
79 catch : m a -> (t -> m a) -> m a
libs/base/Control/IOExcept.idr+2
@@ -1,5 +1,7 @@
11module Control.IOExcept
22
3+%access public
4+
35-- An IO monad with exception handling
46
57record IOExcept' (f:FFI) err a where
libs/base/Control/Isomorphism.idr+1
@@ -4,6 +4,7 @@ import Syntax.PreorderReasoning
44import Data.Fin
55
66%default total
7+%access public
78
89||| An isomorphism between two types
910data Iso : Type -> Type -> Type where
libs/base/Control/Monad/Identity.idr+2
@@ -1,5 +1,7 @@
11module Control.Monad.Identity
22
3+%access public
4+
35public record Identity (a : Type) where
46 constructor Id
57 runIdentity : a
libs/base/Control/Monad/Trans.idr+2
@@ -1,4 +1,6 @@
11module Control.Monad.Trans
22
3+%access public
4+
35interface MonadTrans (t : (Type -> Type) -> Type -> Type) where
46 lift : Monad m => m a -> t m a
libs/base/Data/Complex.idr+2
@@ -5,6 +5,8 @@
55
66module Data.Complex
77
8+%access public
9+
810------------------------------ Rectangular form
911
1012infix 6 :+
libs/base/Data/List/Quantifiers.idr+2
@@ -2,6 +2,8 @@ module Data.List.Quantifiers
22
33import Data.List
44
5+%access public
6+
57||| A proof that some element of a list satisfies some property
68|||
79||| @ P the property to be satsified
libs/base/Data/So.idr+1
@@ -1,6 +1,7 @@
11module Data.So
22
33%default total
4+%access public
45
56||| Ensure that some run-time Boolean test has been performed.
67|||
libs/base/Data/Vect/Quantifiers.idr+2
@@ -2,6 +2,8 @@ module Data.Vect.Quantifiers
22
33import Data.Vect
44
5+%access public
6+
57||| A proof that some element of a vector satisfies some property
68|||
79||| @ P the property to be satsified
libs/base/Debug/Error.idr+1−1
@@ -7,7 +7,7 @@ import System
77|||
88||| @ loc The source location to display for the error
99||| @ message The error to print
10−partial
10+partial abstract
1111error : {default (%runElab sourceLocation) loc : SourceLocation} ->
1212 (message : String) ->
1313 a
libs/base/Debug/Trace.idr+1
@@ -3,6 +3,7 @@ module Debug.Trace
33||| Print a message for debugging purposes as a side effect
44||| @ msg what to print
55||| @ result the final result
6+abstract
67trace : (msg : String) -> (result : a) -> a
78trace x val = unsafePerformIO {ffi=FFI_C} (do putStrLn x; return val)
89
libs/base/Language/Reflection/Utils.idr+2
@@ -4,6 +4,8 @@ import Language.Reflection
44import Language.Reflection.Elab
55import Language.Reflection.Errors
66
7+%access public
8+
79--------------------------------------------------------
810-- Tactic construction conveniences
911--------------------------------------------------------
libs/base/Syntax/PreorderReasoning.idr+2
@@ -1,5 +1,7 @@
11module Syntax.PreorderReasoning
22
3+%access public
4+
35-- QED is first to get the precedence to work out. It's just Refl with an explicit argument.
46syntax [expr] "QED" = qed expr
57-- foo ={ prf }= bar ={ prf' }= fnord QED
libs/base/System/Concurrency/Raw.idr+2
@@ -6,6 +6,8 @@ module System.Concurrency.Raw
66
77import System
88
9+%access abstract
10+
911||| Send a message of any type to the thread with the given thread id
1012||| Returns 1 if the message was sent successfully, 0 otherwise
1113sendToThread : (thread_id : Ptr) -> a -> IO Int
libs/base/System/Info.idr+3
@@ -1,13 +1,16 @@
11module System.Info
22
33||| The Idris backend in use
4+abstract
45backend : String
56backend = prim__systemInfo 0
67
78||| The operating system in use.
9+abstract
810os : String
911os = prim__systemInfo 1
1012
1113||| The triple this program was targeted for
14+abstract
1215targetTriple : String
1316targetTriple = prim__systemInfo 2
libs/contrib/Classes/Verified.idr+2
@@ -4,6 +4,8 @@ import Control.Algebra
44import Control.Algebra.Lattice
55import Control.Algebra.VectorSpace
66
7+%access public
8+
79-- Due to these being basically unused and difficult to implement,
810-- they're in contrib for a bit. Once a design is found that lets them
911-- be implemented for a number of implementations, and we get those
libs/contrib/Control/Algebra.idr+1
@@ -3,6 +3,7 @@ module Control.Algebra
33infixl 6 <->
44infixl 7 <.>
55
6+%access public
67
78||| Sets equipped with a single binary operation that is associative, along with
89||| a neutral element for that binary operation and inverses for all elements.
libs/contrib/Control/Algebra/Lattice.idr+1
@@ -3,6 +3,7 @@ module Control.Algebra.Lattice
33import Control.Algebra
44import Data.Heap
55
6+%access public
67
78||| Sets equipped with a binary operation that is commutative, associative and
89||| idempotent. Must satisfy the following laws:
libs/contrib/Control/Algebra/NumericInstances.idr+1
@@ -7,6 +7,7 @@ import Control.Algebra.VectorSpace
77import Data.Complex
88import Data.ZZ
99
10+%access public
1011
1112Semigroup Integer where
1213 (<+>) = (+)
libs/contrib/Control/Algebra/VectorSpace.idr+2
@@ -2,6 +2,8 @@ module Control.Algebra.VectorSpace
22
33import Control.Algebra
44
5+%access public
6+
57infixl 5 <#>
68infixr 2 <||>
79
libs/contrib/Control/Partial.idr+1−1
@@ -7,7 +7,7 @@ module Control.Partial
77||| @ p the predicate to wait for
88||| @ f the function to repeatedly apply
99||| @ v the starting value
10−partial
10+partial abstract
1111until : (p : a -> Bool) -> (f : a -> a) -> (v : a) -> a
1212until p f v with (p v)
1313 | False = until p f (f v)
libs/contrib/Control/WellFounded.idr+1−1
@@ -6,7 +6,7 @@
66module Control.WellFounded
77
88%default total
9−
9+%access public
1010
1111||| Accessibility: some element `x` is accessible if all `y` such that
1212||| `rel y x` are themselves accessible.
libs/contrib/Data/Fun.idr+1
@@ -3,6 +3,7 @@ module Data.Fun
33import public Data.Vect
44
55%default total
6+%access public
67
78||| Build an n-ary function type from a Vect of Types and a result type
89Fun : Vect n Type -> Type -> Type
libs/contrib/Data/Matrix.idr+1
@@ -5,6 +5,7 @@ module Data.Matrix
55import public Data.Vect
66
77%default total
8+%access public
89
910||| Matrix with n rows and m columns
1011Matrix : Nat -> Nat -> Type -> Type
libs/contrib/Data/Matrix/Algebraic.idr+1−1
@@ -9,7 +9,7 @@ import public Control.Algebra.NumericInstances
99
1010import public Data.Matrix
1111
12−
12+%access public
1313%default total
1414
1515infixr 2 <:> -- vector inner product
libs/contrib/Data/Matrix/Numeric.idr+1
@@ -5,6 +5,7 @@ module Data.Matrix.Numeric
55import public Data.Matrix
66
77%default total
8+%access public
89
910infixr 2 <:> -- vector inner product
1011infixr 2 >< -- vector outer product
libs/contrib/Data/Nat/DivMod.idr+1
@@ -2,6 +2,7 @@
22module Data.Nat.DivMod
33
44%default total
5+%access public
56
67||| The result of euclidean division of natural numbers
78|||
libs/contrib/Data/Rel.idr+1
@@ -2,6 +2,7 @@ module Data.Rel
22
33import Data.Fun
44
5+%access public
56
67||| Build an n-ary relation type from a Vect of Types
78Rel : Vect n Type -> Type
libs/contrib/Data/Sign.idr+2
@@ -1,5 +1,7 @@
11module Data.Sign
22
3+%access public
4+
35||| A representation of signs for signed datatypes such as `ZZ`
46data Sign = Plus | Zero | Minus
57
libs/contrib/contrib.ipkg+2
@@ -7,7 +7,9 @@ modules = Control.Algebra,
77 Control.Isomorphism.Primitives,
88 Control.Partial,
99 Control.WellFounded,
10+
1011 Classes.Verified,
12+
1113 Data.Fun, Data.Rel,
1214 Data.Hash,
1315 Data.Matrix, Data.Matrix.Algebraic, Data.Matrix.Numeric,
libs/effects/Effect/Default.idr+2
@@ -2,6 +2,8 @@ module Effect.Default
22
33import Data.Vect
44
5+%access public
6+
57interface Default a where
68 default : a
79
libs/effects/Effect/Exception.idr+2
@@ -4,6 +4,8 @@ import Effects
44import System
55import Control.IOExcept
66
7+%access public
8+
79data Exception : Type -> Effect where
810 Raise : a -> sig (Exception a) b
911
libs/effects/Effect/File.idr+1
@@ -4,6 +4,7 @@ module Effect.File
44import Effects
55import Control.IOExcept
66
7+%access public
78
89||| A Dependent type to describe File Handles. File handles are
910||| parameterised with the current state of the file: Closed; Open for
libs/effects/Effect/Monad.idr+2
@@ -2,6 +2,8 @@ module Effect.Monad
22
33import Effects
44
5+%access public
6+
57data MonadEffT : List EFFECT -> (Type -> Type) -> Type -> Type where
68 MkMonadEffT : EffM m a xs (\v => xs) -> MonadEffT xs m a
79
libs/effects/Effect/Random.idr+2
@@ -3,6 +3,8 @@ module Effect.Random
33import Effects
44import Data.Vect
55
6+%access public
7+
68data Random : Effect where
79 GetRandom : sig Random Integer Integer
810 SetSeed : Integer -> sig Random () Integer
libs/effects/Effect/Select.idr+2
@@ -2,6 +2,8 @@ module Effect.Select
22
33import Effects
44
5+%access public
6+
57data Selection : Effect where
68 Select : List a -> sig Selection a ()
79
libs/effects/Effect/StdIO.idr+2
@@ -3,6 +3,8 @@ module Effect.StdIO
33import Effects
44import Control.IOExcept
55
6+%access public
7+
68-------------------------------------------------------------
79-- IO effects internals
810-------------------------------------------------------------
libs/effects/Effect/System.idr+2
@@ -7,6 +7,8 @@ import Effects
77import System
88import Control.IOExcept
99
10+%access public
11+
1012data System : Effect where
1113 Args : sig System (List String)
1214 Time : sig System Integer
libs/prelude/Decidable/Equality.idr+2
@@ -9,6 +9,8 @@ import Prelude.List
99import Prelude.Nat
1010import Prelude.Maybe
1111
12+%access public
13+
1214--------------------------------------------------------------------------------
1315-- Utility lemmas
1416--------------------------------------------------------------------------------
libs/prelude/Language/Reflection/Elab.idr+2
@@ -16,6 +16,8 @@ import Prelude.Monad
1616import Prelude.Nat
1717import Language.Reflection
1818
19+%access public
20+
1921data Fixity = Infixl Nat | Infixr Nat | Infix Nat | Prefix Nat
2022
2123||| Erasure annotations reflect Idris's idea of what is intended to be
libs/prelude/Language/Reflection/Errors.idr+2
@@ -8,6 +8,8 @@ import Prelude.Bool
88import Prelude.List
99import Prelude.Maybe
1010
11+%access public
12+
1113data Err = Msg String
1214 | InternalMsg String
1315 | CantUnify Bool TT TT Err (List (TTName, TT)) Int
libs/prelude/Prelude/Applicative.idr+2
@@ -8,6 +8,8 @@ import Prelude.Interfaces
88import Prelude.Foldable
99import Prelude.Functor
1010
11+%access public
12+
1113---- Applicative functors/Idioms
1214
1315infixl 2 <*>
libs/prelude/Prelude/Basics.idr+3−1
@@ -1,7 +1,9 @@
11module Prelude.Basics
22
33import Builtins
4−
4+
5+%access public
6+
57Not : Type -> Type
68Not a = a -> Void
79
libs/prelude/Prelude/Bool.idr+2
@@ -4,6 +4,8 @@ import Builtins
44
55import Prelude.Uninhabited
66
7+%access public
8+
79||| Boolean Data Type
810%case data Bool = False | True
911
libs/prelude/Prelude/Cast.idr+2
@@ -3,6 +3,8 @@ module Prelude.Cast
33import Prelude.Bool
44import public Builtins
55
6+%access public
7+
68||| Interface for transforming an instance of a data type to another type.
79interface Cast from to where
810 ||| Perform a cast operation.
libs/prelude/Prelude/Chars.idr+2
@@ -7,6 +7,8 @@ import Prelude.List
77import Prelude.Cast
88import Builtins
99
10+%access public
11+
1012||| Convert the number to its ASCII equivalent.
1113chr : Int -> Char
1214chr x = if (x >= 0 && x < 0x110000)
libs/prelude/Prelude/Either.idr+2
@@ -8,6 +8,8 @@ import Prelude.Interfaces
88import Prelude.Maybe
99import Prelude.List
1010
11+%access public
12+
1113||| A sum type
1214%elim data Either : (a, b : Type) -> Type where
1315 ||| One possibility of the sum, conventionally used to represent errors
libs/prelude/Prelude/Functor.idr+2
@@ -2,6 +2,8 @@ module Prelude.Functor
22
33import Prelude.Basics
44
5+%access public
6+
57||| Functors allow a uniform action over a parameterised type.
68||| @ f a parameterised type
79interface Functor (f : Type -> Type) where
libs/prelude/Prelude/Interfaces.idr+2
@@ -4,6 +4,8 @@ import Builtins
44import Prelude.Basics
55import Prelude.Bool
66
7+%access public
8+
79-- Numerical Operator Precedence
810infixl 5 ==, /=
911infixl 6 <, <=, >, >=
libs/prelude/Prelude/Providers.idr+2
@@ -4,6 +4,8 @@ import Prelude.Functor
44import Prelude.Applicative
55import Prelude.Monad
66
7+%access public
8+
79||| Type providers must build one of these in an IO computation.
810public
911data Provider : (a : Type) -> Type where
libs/prelude/Prelude/Show.idr+2
@@ -14,6 +14,8 @@ import Prelude.Either
1414import Prelude.Nat
1515import Prelude.Strings
1616
17+%access public
18+
1719%default total
1820
1921||| The precedence of an Idris operator or syntactic context.
libs/prelude/Prelude/Strings.idr+2
@@ -17,6 +17,8 @@ import Prelude.Nat
1717import Prelude.Monad
1818import Decidable.Equality
1919
20+%access public
21+
2022partial
2123foldr1 : (a -> a -> a) -> List a -> a
2224foldr1 _ [x] = x
libs/prelude/Prelude/Traversable.idr+2
@@ -7,6 +7,8 @@ import Prelude.Applicative
77import Prelude.Foldable
88import Prelude.Functor
99
10+%access public
11+
1012traverse_ : (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
1113traverse_ f = foldr ((*>) . f) (pure ())
1214
libs/prelude/Prelude/Uninhabited.idr+2
@@ -5,6 +5,8 @@ module Prelude.Uninhabited
55
66import Builtins
77
8+%access public
9+
810||| A canonical proof that some type is empty
911interface Uninhabited t where
1012 ||| If I have a t, I've had a contradiction
libs/pruviloj/Pruviloj/Core.idr+2
@@ -5,6 +5,8 @@ module Pruviloj.Core
55
66import Language.Reflection.Utils
77
8+%access public
9+
810||| Run something for effects, throwing away the return value
911ignore : Functor f => f a -> f ()
1012ignore x = map (const ()) x
libs/pruviloj/Pruviloj/Internals.idr+2
@@ -7,6 +7,8 @@ import Pruviloj.Renamers
77
88import Data.Vect
99
10+%access public
11+
1012||| Get the name of a reflected type constructor argument.
1113tyConArgName : TyConArg -> TTName
1214tyConArgName (TyConParameter a) = name a
libs/pruviloj/Pruviloj/Internals/TyConInfo.idr+1−1
@@ -6,7 +6,7 @@ import Pruviloj.Renamers
66
77import Language.Reflection.Utils
88
9−
9+%access public
1010
1111||| A representation of a type constructor in which all argument names
1212||| are made unique and they are separated into params and then
libs/pruviloj/Pruviloj/Renamers.idr+2
@@ -2,6 +2,8 @@ module Pruviloj.Renamers
22
33import Language.Reflection.Utils
44
5+%access public
6+
57||| A renamer keeps track of names to be substituted
68Renamer : Type
79Renamer = TTName -> Maybe TTName
src/Idris/Core/Evaluate.hs+3−5
@@ -12,7 +12,7 @@ module Idris.Core.Evaluate(normalise, normaliseTrace, normaliseC,
1212 addDatatype, addCasedef, simplifyCasedef, addOperator,
1313 lookupNames, lookupTyName, lookupTyNameExact, lookupTy, lookupTyExact,
1414 lookupP, lookupP_all, lookupDef, lookupNameDef, lookupDefExact, lookupDefAcc, lookupDefAccExact, lookupVal,
15− mapDefCtxt,
15+ mapDefCtxt,
1616 lookupTotal, lookupNameTotal, lookupMetaInformation, lookupTyEnv, isTCDict, isDConName, canBeDConName, isTConName, isConName, isFnName,
1717 Value(..), Quote(..), initEval, uniqueNameCtxt, uniqueBindersCtxt, definitions,
1818 isUniverse) where
@@ -253,12 +253,10 @@ eval traceon ctxt ntimes genv tm opts = ev ntimes [] True [] tm where
253253 ev ntimes (n:stk) True env tm
254254 [(Function _ tm, Public)] ->
255255 ev ntimes (n:stk) True env tm
256− [(Function _ tm, Hidden)] ->
257− ev ntimes (n:stk) True env tm
258256 [(TyDecl nt ty, _)] -> do vty <- ev ntimes stk True env ty
259257 return $ VP nt n vty
260258 [(CaseOp ci _ _ _ _ cd, acc)]
261− | (acc /= Frozen || sUN "assert_total" `elem` stk) &&
259+ | (acc == Public || sUN "assert_total" `elem` stk) &&
262260 null (fst (cases_totcheck cd)) -> -- unoptimised version
263261 let (ns, tree) = getCases cd in
264262 if blockSimplify ci n stk
@@ -376,7 +374,7 @@ eval traceon ctxt ntimes genv tm opts = ev ntimes [] True [] tm where
376374 do let val = lookupDefAcc n (spec || atRepl) ctxt
377375 case val of
378376 [(CaseOp ci _ _ _ _ cd, acc)]
379− | acc /= Frozen || sUN "assert_total" `elem` stk ->
377+ | acc == Public || sUN "assert_total" `elem` stk ->
380378 -- unoptimised version
381379 let (ns, tree) = getCases cd in
382380 if blockSimplify ci n stk
src/Idris/Elab/Term.hs+3−1
@@ -2476,8 +2476,10 @@ withErrorReflection x = idrisCatch x (\ e -> handle e >>= ierror)
24762476 OK hs -> return hs
24772477
24782478 -- Normalize error handler terms to produce the new messages
2479+ -- Need to use 'normaliseAll' since we have to reduce private
2480+ -- names in error handlers too
24792481 ctxt <- getContext
2480− let results = map (normalise ctxt []) (map fst handlers)
2482+ let results = map (normaliseAll ctxt []) (map fst handlers)
24812483 logElab 3 $ "New error message info: " ++ concat (intersperse " and " (map show results))
24822484
24832485 -- For each handler term output, either discard it if it is Nothing or reify it the Haskell equivalent
src/Idris/IBC.hs+43−30
@@ -3,7 +3,7 @@
33
44module Idris.IBC (loadIBC, loadPkgIndex,
55 writeIBC, writePkgIndex,
6− hasValidIBCVersion) where
6+ hasValidIBCVersion, IBCPhase(..)) where
77
88import Idris.Core.Evaluate
99import Idris.Core.TT
@@ -40,13 +40,14 @@ import System.Directory
4040import Codec.Archive.Zip
4141
4242ibcVersion :: Word16
43−ibcVersion = 130
43+ibcVersion = 131
4444
4545-- When IBC is being loaded - we'll load different things (and omit different
4646-- structures/definitions) depending on which phase we're in
4747data IBCPhase = IBC_Building -- ^ when building the module tree
48− | IBC_REPL -- ^ when loading modules for the REPL
49− | IBC_IDE -- ^ when running in IDE mode
48+ | IBC_REPL Bool -- ^ when loading modules for the REPL
49+ -- Bool = True for top level module
50+ deriving (Show, Eq)
5051
5152data IBCFile = IBCFile { ver :: Word16,
5253 sourcefile :: FilePath,
@@ -69,13 +70,10 @@ data IBCFile = IBCFile { ver :: Word16,
6970 ibc_cgflags :: ![(Codegen, String)],
7071 ibc_dynamic_libs :: ![String],
7172 ibc_hdrs :: ![(Codegen, String)],
72− ibc_access :: ![(Name, Accessibility)],
73− ibc_total :: ![(Name, Totality)],
7473 ibc_totcheckfail :: ![(FC, String)],
7574 ibc_flags :: ![(Name, [FnOpt])],
7675 ibc_fninfo :: ![(Name, FnInfo)],
7776 ibc_cg :: ![(Name, CGInfo)],
78− ibc_defs :: ![(Name, Def)],
7977 ibc_docstrings :: ![(Name, (Docstring D.DocTerm, [(Name, Docstring D.DocTerm)]))],
8078 ibc_moduledocs :: ![(Name, Docstring D.DocTerm)],
8179 ibc_transforms :: ![(Name, (Term, Term))],
@@ -94,7 +92,10 @@ data IBCFile = IBCFile { ver :: Word16,
9492 ibc_usage :: ![(Name, Int)],
9593 ibc_exports :: ![Name],
9694 ibc_autohints :: ![(Name, Name)],
97− ibc_deprecated :: ![(Name, String)]
95+ ibc_deprecated :: ![(Name, String)],
96+ ibc_defs :: ![(Name, Def)],
97+ ibc_total :: ![(Name, Totality)],
98+ ibc_access :: ![(Name, Accessibility)]
9899 }
99100 deriving Show
100101{-!
@@ -102,7 +103,7 @@ deriving instance Binary IBCFile
102103!-}
103104
104105initIBC :: IBCFile
105−initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing [] [] [] []
106+initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing [] [] [] [] [] [] []
106107
107108hasValidIBCVersion :: FilePath -> Idris Bool
108109hasValidIBCVersion fp = do
@@ -113,8 +114,9 @@ hasValidIBCVersion fp = do
113114 return (ver == ibcVersion)
114115
115116loadIBC :: Bool -- ^ True = reexport, False = make everything private
117+ -> IBCPhase
116118 -> FilePath -> Idris ()
117−loadIBC reexport fp
119+loadIBC reexport phase fp
118120 = do imps <- getImported
119121 let redo = case lookup fp imps of
120122 Nothing -> True
@@ -125,7 +127,7 @@ loadIBC reexport fp
125127 case toArchiveOrFail archiveFile of
126128 Left _ -> ifail $ fp ++ " isn't loadable, it may have an old ibc format.\n"
127129 ++ "Please clean and rebuild it."
128− Right archive -> do process reexport archive fp
130+ Right archive -> do process reexport phase archive fp
129131 addImported reexport fp
130132-- dumpTT
131133
@@ -134,7 +136,7 @@ loadPkgIndex :: String -> Idris ()
134136loadPkgIndex pkg = do ddir <- runIO $ getIdrisLibDir
135137 addImportDir (ddir </> pkg)
136138 fp <- findPkgIndex pkg
137− loadIBC True fp
139+ loadIBC True IBC_Building fp
138140
139141
140142makeEntry :: (Binary b) => String -> [b] -> Maybe Entry
@@ -164,13 +166,10 @@ entries i = catMaybes [Just $ toEntry "ver" 0 (encode $ ver i),
164166 makeEntry "ibc_cgflags" (ibc_cgflags i),
165167 makeEntry "ibc_dynamic_libs" (ibc_dynamic_libs i),
166168 makeEntry "ibc_hdrs" (ibc_hdrs i),
167− makeEntry "ibc_access" (ibc_access i),
168− makeEntry "ibc_total" (ibc_total i),
169169 makeEntry "ibc_totcheckfail" (ibc_totcheckfail i),
170170 makeEntry "ibc_flags" (ibc_flags i),
171171 makeEntry "ibc_fninfo" (ibc_fninfo i),
172172 makeEntry "ibc_cg" (ibc_cg i),
173− makeEntry "ibc_defs" (ibc_defs i),
174173 makeEntry "ibc_docstrings" (ibc_docstrings i),
175174 makeEntry "ibc_moduledocs" (ibc_moduledocs i),
176175 makeEntry "ibc_transforms" (ibc_transforms i),
@@ -189,7 +188,10 @@ entries i = catMaybes [Just $ toEntry "ver" 0 (encode $ ver i),
189188 makeEntry "ibc_usage" (ibc_usage i),
190189 makeEntry "ibc_exports" (ibc_exports i),
191190 makeEntry "ibc_autohints" (ibc_autohints i),
192− makeEntry "ibc_deprecated" (ibc_deprecated i)]
191+ makeEntry "ibc_deprecated" (ibc_deprecated i),
192+ makeEntry "ibc_defs" (ibc_defs i),
193+ makeEntry "ibc_total" (ibc_total i),
194+ makeEntry "ibc_access" (ibc_access i)]
193195
194196writeArchive :: FilePath -> IBCFile -> Idris ()
195197writeArchive fp i = do let a = L.foldl (\x y -> addEntryToArchive y x) emptyArchive (entries i)
@@ -323,8 +325,9 @@ getEntry alt f a = case findEntryByPath f a of
323325 Just e -> return $! (force . decode . fromEntry) e
324326
325327process :: Bool -- ^ Reexporting
328+ -> IBCPhase
326329 -> Archive -> FilePath -> Idris ()
327−process reexp i fn = do
330+process reexp phase i fn = do
328331 ver <- getEntry 0 "ver" i
329332 when (ver /= ibcVersion) $ do
330333 logIBC 1 "ibc out of date"
@@ -336,7 +339,7 @@ process reexp i fn = do
336339 srcok <- runIO $ doesFileExist source
337340 when srcok $ timestampOlder source fn
338341 pImportDirs =<< getEntry [] "ibc_importdirs" i
339− pImports reexp =<< getEntry [] "ibc_imports" i
342+ pImports reexp phase =<< getEntry [] "ibc_imports" i
340343 pImps =<< getEntry [] "ibc_implicits" i
341344 pFixes =<< getEntry [] "ibc_fixes" i
342345 pStatics =<< getEntry [] "ibc_statics" i
@@ -353,12 +356,9 @@ process reexp i fn = do
353356 pCGFlags =<< getEntry [] "ibc_cgflags" i
354357 pDyLibs =<< getEntry [] "ibc_dynamic_libs" i
355358 pHdrs =<< getEntry [] "ibc_hdrs" i
356− pDefs reexp =<< getEntry [] "ibc_defs" i
357359 pPatdefs =<< getEntry [] "ibc_patdefs" i
358− pAccess reexp =<< getEntry [] "ibc_access" i
359360 pFlags =<< getEntry [] "ibc_flags" i
360361 pFnInfo =<< getEntry [] "ibc_fninfo" i
361− pTotal =<< getEntry [] "ibc_total" i
362362 pTotCheckErr =<< getEntry [] "ibc_totcheckfail" i
363363 pCG =<< getEntry [] "ibc_cg" i
364364 pDocs =<< getEntry [] "ibc_docstrings" i
@@ -379,6 +379,9 @@ process reexp i fn = do
379379 pExports =<< getEntry [] "ibc_exports" i
380380 pAutoHints =<< getEntry [] "ibc_autohints" i
381381 pDeprecate =<< getEntry [] "ibc_deprecated" i
382+ pDefs reexp =<< getEntry [] "ibc_defs" i
383+ pTotal =<< getEntry [] "ibc_total" i
384+ pAccess reexp phase =<< getEntry [] "ibc_access" i
382385
383386timestampOlder :: FilePath -> FilePath -> Idris ()
384387timestampOlder src ibc = do srct <- runIO $ getModificationTime src
@@ -412,8 +415,8 @@ pDeprecate ns = mapM_ (\(n,reason) -> addDeprecated n reason) ns
412415pImportDirs :: [FilePath] -> Idris ()
413416pImportDirs fs = mapM_ addImportDir fs
414417
415−pImports :: Bool -> [(Bool, FilePath)] -> Idris ()
416−pImports reexp fs
418+pImports :: Bool -> IBCPhase -> [(Bool, FilePath)] -> Idris ()
419+pImports reexp phase fs
417420 = do mapM_ (\(re, f) ->
418421 do i <- getIState
419422 ibcsd <- valIBCSubDir i
@@ -422,6 +425,9 @@ pImports reexp fs
422425-- if (f `elem` imported i)
423426-- then logLvl 1 $ "Already read " ++ f
424427 putIState (i { imported = f : imported i })
428+ let phase' = case phase of
429+ IBC_REPL _ -> IBC_REPL False
430+ p -> p
425431 case fp of
426432 LIDR fn -> do
427433 logIBC 1 $ "Failed at " ++ fn
@@ -429,7 +435,7 @@ pImports reexp fs
429435 IDR fn -> do
430436 logIBC 1 $ "Failed at " ++ fn
431437 ifail "Must be an ibc"
432− IBC fn src -> loadIBC (reexp && re) fn)
438+ IBC fn src -> loadIBC (reexp && re) phase' fn)
433439 fs
434440
435441pImps :: [(Name, [PArg])] -> Idris ()
@@ -528,10 +534,7 @@ pDefs reexp ds
528534 _ -> do logIBC 1 $ "SOLVING " ++ show n
529535 solveDeferred n
530536 updateIState (\i -> i { tt_ctxt = addCtxtDef n d' (tt_ctxt i) })
531−-- logLvl 1 $ "Added " ++ show (n, d')
532− if (not reexp) then do logIBC 1 $ "Not exporting " ++ show n
533− setAccessibility n Hidden
534− else logIBC 1 $ "Exporting " ++ show n) ds
537+ ) ds
535538 where
536539 updateDef (CaseOp c t args o s cd)
537540 = do o' <- mapM updateOrig o
@@ -599,12 +602,22 @@ pMDocs ds = mapM_ (\ (n, d) -> updateIState (\i ->
599602 i { idris_moduledocs = addDef n d (idris_moduledocs i) })) ds
600603
601604pAccess :: Bool -- ^ Reexporting?
605+ -> IBCPhase
602606 -> [(Name, Accessibility)] -> Idris ()
603−pAccess reexp ds
607+pAccess reexp phase ds
604608 = mapM_ (\ (n, a_in) ->
605609 do let a = if reexp then a_in else Hidden
606610 logIBC 3 $ "Setting " ++ show (a, n) ++ " to " ++ show a
607− updateIState (\i -> i { tt_ctxt = setAccess n a (tt_ctxt i) })) ds
611+ updateIState (\i -> i { tt_ctxt = setAccess n a (tt_ctxt i) })
612+
613+ if (not reexp) then do logIBC 1 $ "Not exporting " ++ show n
614+ setAccessibility n Hidden
615+ else logIBC 1 $ "Exporting " ++ show n
616+ -- Everything should be available at the REPL from
617+ -- things imported publicly
618+ when (phase == IBC_REPL True) $
619+ setAccessibility n Public
620+ ) ds
608621
609622pFlags :: [(Name, [FnOpt])] -> Idris ()
610623pFlags ds = mapM_ (\ (n, a) -> setFlags n a) ds
src/Idris/Parser.hs+13−14
@@ -1565,17 +1565,17 @@ parseProg syn fname input mrk
15651565 return (ds, i')
15661566
15671567{- | Load idris module and show error if something wrong happens -}
1568−loadModule :: FilePath -> Idris (Maybe String)
1569−loadModule f
1570− = idrisCatch (loadModule' f)
1568+loadModule :: FilePath -> IBCPhase -> Idris (Maybe String)
1569+loadModule f phase
1570+ = idrisCatch (loadModule' f phase)
15711571 (\e -> do setErrSpan (getErrSpan e)
15721572 ist <- getIState
15731573 iWarn (getErrSpan e) $ pprintErr ist e
15741574 return Nothing)
15751575
15761576{- | Load idris module -}
1577−loadModule' :: FilePath -> Idris (Maybe String)
1578−loadModule' f
1577+loadModule' :: FilePath -> IBCPhase -> Idris (Maybe String)
1578+loadModule' f phase
15791579 = do i <- getIState
15801580 let file = takeWhile (/= ' ') f
15811581 ibcsd <- valIBCSubDir i
@@ -1589,7 +1589,7 @@ loadModule' f
15891589 IDR fn -> loadSource False fn Nothing
15901590 LIDR fn -> loadSource True fn Nothing
15911591 IBC fn src ->
1592− idrisCatch (loadIBC True fn)
1592+ idrisCatch (loadIBC True phase fn)
15931593 (\c -> do logParser 1 $ fn ++ " failed " ++ pshow i c
15941594 case src of
15951595 IDR sfn -> loadSource False sfn Nothing
@@ -1597,18 +1597,18 @@ loadModule' f
15971597 return $ Just file
15981598
15991599{- | Load idris code from file -}
1600−loadFromIFile :: Bool -> IFileType -> Maybe Int -> Idris ()
1601−loadFromIFile reexp i@(IBC fn src) maxline
1600+loadFromIFile :: Bool -> IBCPhase -> IFileType -> Maybe Int -> Idris ()
1601+loadFromIFile reexp phase i@(IBC fn src) maxline
16021602 = do logParser 1 $ "Skipping " ++ getSrcFile i
1603− idrisCatch (loadIBC reexp fn)
1603+ idrisCatch (loadIBC reexp phase fn)
16041604 (\err -> ierror $ LoadingFailed fn err)
16051605 where
16061606 getSrcFile (IDR fn) = fn
16071607 getSrcFile (LIDR fn) = fn
16081608 getSrcFile (IBC f src) = getSrcFile src
16091609
1610−loadFromIFile _ (IDR fn) maxline = loadSource' False fn maxline
1611−loadFromIFile _ (LIDR fn) maxline = loadSource' True fn maxline
1610+loadFromIFile _ _ (IDR fn) maxline = loadSource' False fn maxline
1611+loadFromIFile _ _ (LIDR fn) maxline = loadSource' True fn maxline
16121612
16131613{-| Load idris source code and show error if something wrong happens -}
16141614loadSource' :: Bool -> FilePath -> Maybe Int -> Idris ()
@@ -1639,7 +1639,7 @@ loadSource lidr f toline
16391639 LIDR fn -> ifail $ "No ibc for " ++ f
16401640 IDR fn -> ifail $ "No ibc for " ++ f
16411641 IBC fn src ->
1642− do loadIBC True fn
1642+ do loadIBC True IBC_Building fn
16431643 let srcFn = case src of
16441644 IDR fn -> Just fn
16451645 LIDR fn -> Just fn
@@ -1803,8 +1803,7 @@ addHides :: [(Name, Maybe Accessibility)] -> Idris ()
18031803addHides xs = do i <- getIState
18041804 let defh = default_access i
18051805 let (hs, as) = partition isNothing xs
1806− unless (null as) $
1807− mapM_ doHide
1806+ mapM_ doHide
18081807 (map (\ (n, _) -> (n, defh)) hs ++
18091808 map (\ (n, Just a) -> (n, a)) as)
18101809 where isNothing (_, Nothing) = True
src/Idris/REPL.hs+18−13
@@ -12,6 +12,7 @@ import Idris.REPLParser
1212import Idris.ElabDecls
1313import Idris.Erasure
1414import Idris.Error
15+import Idris.IBC
1516import Idris.ErrReverse
1617import Idris.Delaborate
1718import Idris.Docstrings (Docstring, overview, renderDocstring, renderDocTerm)
@@ -735,7 +736,7 @@ processInput cmd orig inputs efile
735736 return (Just mod)
736737 Success (Right (ModImport f)) ->
737738 do clearErr
738− fmod <- loadModule f
739+ fmod <- loadModule f (IBC_REPL True)
739740 return (Just (inputs ++ maybe [] (:[]) fmod))
740741 Success (Right Edit) -> do -- takeMVar stvar
741742 edit efile orig
@@ -817,7 +818,7 @@ process fn Warranty = iPrintResult warranty
817818process fn (ChangeDirectory f)
818819 = do runIO $ setCurrentDirectory f
819820 return ()
820−process fn (ModImport f) = do fmod <- loadModule f
821+process fn (ModImport f) = do fmod <- loadModule f (IBC_REPL True)
821822 case fmod of
822823 Just pr -> isetPrompt pr
823824 Nothing -> iPrintError $ "Can't find import " ++ f
@@ -1089,7 +1090,7 @@ process fn (DebugInfo n)
10891090 when (not (null di)) $ iputStrLn (show di)
10901091 let imps = lookupCtxt n (idris_implicits i)
10911092 when (not (null imps)) $ iputStrLn (show imps)
1092− let d = lookupDef n (tt_ctxt i)
1093+ let d = lookupDefAcc n False (tt_ctxt i)
10931094 when (not (null d)) $ iputStrLn $ "Definition: " ++ (show (head d))
10941095 let cg = lookupCtxtName n (idris_callgraph i)
10951096 i <- getIState
@@ -1238,12 +1239,15 @@ process fn (Compile codegen f)
12381239 iPrintError $ "Invalid filename for compiler output \"" ++ f ++"\""
12391240 | otherwise = do opts <- getCmdLine
12401241 let iface = Interface `elem` opts
1242+ let mainname = sNS (sUN "main") ["Main"]
1243+
12411244 m <- if iface then return Nothing else
12421245 do (m', _) <- elabVal recinfo ERHS
12431246 (PApp fc (PRef fc [] (sUN "run__IO"))
1244− [pexp $ PRef fc [] (sNS (sUN "main") ["Main"])])
1247+ [pexp $ PRef fc [] mainname])
12451248 return (Just m')
12461249 ir <- compile codegen f m
1250+
12471251 i <- getIState
12481252 runIO $ generate codegen (fst (head (idris_imported i))) ir
12491253 where fc = fileFC "main"
@@ -1559,7 +1563,7 @@ loadInputs inputs toline -- furthest line to read in input source files
15591563 logParser 1 ("MODULE TREE : " ++ show modTree)
15601564 logParser 1 ("RELOAD: " ++ show ifiles)
15611565 when (not (all ibc ifiles) || loadCode) $
1562− tryLoad False (filter (not . ibc) ifiles)
1566+ tryLoad False IBC_Building (filter (not . ibc) ifiles)
15631567 -- return the files that need rechecking
15641568 return (input, ifiles))
15651569 ninputs
@@ -1570,7 +1574,8 @@ loadInputs inputs toline -- furthest line to read in input source files
15701574 Nothing ->
15711575 do putIState $!! ist { idris_tyinfodata = tidata }
15721576 ibcfiles <- mapM findNewIBC (nub (concat (map snd ifiles)))
1573− tryLoad True (mapMaybe id ibcfiles)
1577+-- logLvl 0 $ "Loading from " ++ show ibcfiles
1578+ tryLoad True (IBC_REPL True) (mapMaybe id ibcfiles)
15741579 _ -> return ()
15751580 exports <- findExports
15761581
@@ -1590,9 +1595,9 @@ loadInputs inputs toline -- furthest line to read in input source files
15901595 iWarn emptyFC $ pprintErr i e
15911596 return [])
15921597 where -- load all files, stop if any fail
1593− tryLoad :: Bool -> [IFileType] -> Idris ()
1594− tryLoad keepstate [] = warnTotality >> return ()
1595− tryLoad keepstate (f : fs)
1598+ tryLoad :: Bool -> IBCPhase -> [IFileType] -> Idris ()
1599+ tryLoad keepstate phase [] = warnTotality >> return ()
1600+ tryLoad keepstate phase (f : fs)
15961601 = do ist <- getIState
15971602 let maxline
15981603 = case toline of
@@ -1605,7 +1610,7 @@ loadInputs inputs toline -- furthest line to read in input source files
16051610 then Just l
16061611 else Nothing
16071612 _ -> Nothing
1608− loadFromIFile True f maxline
1613+ loadFromIFile True phase f maxline
16091614 inew <- getIState
16101615 -- FIXME: Save these in IBC to avoid this hack! Need to
16111616 -- preserve it all from source inputs
@@ -1623,7 +1628,7 @@ loadInputs inputs toline -- furthest line to read in input source files
16231628 ist <- getIState
16241629 putIState $!! ist { idris_tyinfodata = tidata,
16251630 idris_patdefs = patdefs }
1626− tryLoad keepstate fs
1631+ tryLoad keepstate phase fs
16271632
16281633 ibc (IBC _ _) = True
16291634 ibc _ = False
@@ -1727,10 +1732,10 @@ idrisMain opts =
17271732 addPkgDir "base"
17281733 mapM_ addPkgDir pkgdirs
17291734 elabPrims
1730− when (not (NoBuiltins `elem` opts)) $ do x <- loadModule "Builtins"
1735+ when (not (NoBuiltins `elem` opts)) $ do x <- loadModule "Builtins" (IBC_REPL True)
17311736 addAutoImport "Builtins"
17321737 return ()
1733− when (not (NoPrelude `elem` opts)) $ do x <- loadModule "Prelude"
1738+ when (not (NoPrelude `elem` opts)) $ do x <- loadModule "Prelude" (IBC_REPL True)
17341739 addAutoImport "Prelude"
17351740 return ()
17361741 when (runrepl && not idesl) initScript
src/Pkg/Package.hs+1−1
@@ -142,7 +142,7 @@ documentPkg fp =
142142 setCurrentDirectory pkgDir
143143 let run l = runExceptT . execStateT l
144144 load [] = return ()
145− load (f:fs) = do loadModule f; load fs
145+ load (f:fs) = do loadModule f IBC_Building; load fs
146146 loader = do idrisMain opts; addImportDir (sourcedir pkgdesc); load fs
147147 idrisInstance <- run loader idrisInit
148148 setCurrentDirectory cd
test/basic009/A.idr+1
@@ -1,4 +1,5 @@
11module A
22
3+public
34num : Nat
45num = 0
test/basic009/B/C.idr+1
@@ -1,4 +1,5 @@
11module B.C
22
3+public
34num : Nat
45num = 1
test/dsl002/Resimp.idr+2
@@ -3,6 +3,8 @@ module Resimp
33import public Data.Vect
44import public Data.Fin
55
6+%access public
7+
68-- IO operations which read a resource
79data Reader : Type -> Type where
810 MkReader : IO a -> Reader a
test/effects003/VectMissing.idr+1
@@ -6,6 +6,7 @@ import Data.Vect
66implementation Uninhabited (Elem x []) where
77 uninhabited Here impossible
88
9+abstract
910shrink : (xs : Vect (S n) a) -> Elem x xs -> Vect n a
1011shrink (x :: ys) Here = ys
1112shrink (y :: []) (There p) = absurd p
test/idrisdoc002/TestFunctions.idr+2−1
@@ -1,5 +1,6 @@
11module TestFunctions
22
33||| Test function
4+public
45test : ()
5−test = ()
6+test = ()
test/idrisdoc003/TestDatatypes.idr+2−1
@@ -1,6 +1,7 @@
11module TestDatatypes
22
33||| This is another test
4+public
45data Test : Type where
56 ||| Test constructor
6− ATest : Test
7+ ATest : Test
test/idrisdoc004/TestTypeclasses.idr+1
@@ -3,6 +3,7 @@ module TestTypeclasses
33||| This is a test
44|||
55||| @ a Test arg
6+public
67interface Test a where
78 ||| Test function
89 test : a -> Int
test/idrisdoc005/TestTracing.idr+2−1
@@ -1,4 +1,5 @@
11module TestTracing
22
3+public
34test : Bool
4−test = True
5+test = True
test/idrisdoc006/A/fully/Qualified/NAME.idr+2−2
@@ -1,6 +1,6 @@
11module A.fully.Qualified.NAME
22
33||| This is another test
4−data Test : Type where
4+public data Test : Type where
55 ||| Test constructor
6− ATest : Test
6+ ATest : Test
test/idrisdoc006/B.idr+2−1
@@ -1,5 +1,6 @@
11module B
22
33||| Test function
4+public
45test : ()
5−test = ()
6+test = ()
test/idrisdoc009/Test.idr+2
@@ -23,6 +23,8 @@
2323module Test
2424import Data.Complex
2525
26+%access public
27+
2628myplus : Nat -> Nat -> Nat
2729myplus Z j = j
2830myplus (S k) j = S (myplus k j)
test/literate001/Lit.lidr+2−2
@@ -2,12 +2,12 @@
22
33Test some string primitives while we're at it
44
5−> st : String
5+> abstract st : String
66> st = "abcdefg"
77
88Literate main program
99
10−> main : IO ()
10+> abstract main : IO ()
1111> main = do { putStrLn (show (strHead st))
1212> putStrLn (show (strIndex st 3))
1313> putStrLn (strCons 'z' st)
test/proof002/Reflect.idr+1
@@ -2,6 +2,7 @@ module Reflect
22
33import Decidable.Equality
44
5+%access public
56%default total
67
78using (xs : List a, ys : List a, G : List (List a))
test/proof002/expected+3−3
@@ -1,8 +1,8 @@
1−Reflect.idr:173:21-26:
1+Reflect.idr:174:21-26:
22This style of tactic proof is deprecated. See %runElab for the replacement.
3−Reflect.idr:182:21-26:
3+Reflect.idr:183:21-26:
44This style of tactic proof is deprecated. See %runElab for the replacement.
5−Reflect.idr:190:15-20:
5+Reflect.idr:191:15-20:
66This style of tactic proof is deprecated. See %runElab for the replacement.
77test030a.idr:12:26-14:1:
88When checking right hand side of testReflect1 with expected type
test/proof003/Parity.idr+2
@@ -1,5 +1,7 @@
11module Parity
22
3+%access public
4+
35data Parity : Nat -> Type where
46 Even : {n : Nat} -> Parity (n + n)
57 Odd : {n : Nat} -> Parity (S (n + n))
test/proof003/expected+2−2
@@ -1,6 +1,6 @@
1−Parity.idr:15:18-23:
1+Parity.idr:17:18-23:
22This style of tactic proof is deprecated. See %runElab for the replacement.
3−Parity.idr:22:18-23:
3+Parity.idr:24:18-23:
44This style of tactic proof is deprecated. See %runElab for the replacement.
55test015.idr:88:15-20:
66This style of tactic proof is deprecated. See %runElab for the replacement.
test/reg007/A.lidr+1−1
@@ -1,5 +1,5 @@
11> module A
22
3−> n : Nat
3+> public n : Nat
44> n = ?lala
55