2020-12-03 15:28:20 +03:00
|
|
|
1/1: Building Fld (Fld.idr)
|
2021-05-14 19:35:21 +03:00
|
|
|
Warning: We are about to implicitly bind the following lowercase names.
|
|
|
|
You may be unintentionally shadowing the associated global definitions:
|
|
|
|
a is shadowing Main.R1.R1.a
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:68:11--68:20
|
|
|
|
64 |
|
|
|
|
65 | public export
|
|
|
|
66 | record R2 where
|
|
|
|
67 | constructor MkR
|
|
|
|
68 | {auto field : a}
|
2021-10-03 12:15:01 +03:00
|
|
|
^^^^^^^^^
|
|
|
|
|
2021-05-14 19:35:21 +03:00
|
|
|
Warning: We are about to implicitly bind the following lowercase names.
|
|
|
|
You may be unintentionally shadowing the associated global definitions:
|
|
|
|
a is shadowing Main.R2.R2.a, Main.R1.R1.a
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:76:1--81:38
|
|
|
|
76 | interface Show a => (num : Num a) => MyIface a where -- Some interface with
|
|
|
|
77 | constructor MkIface
|
|
|
|
78 | -- constraints
|
|
|
|
79 | data MyData : a -> Type -- and a data declaration.
|
|
|
|
80 | someFunc : a -> a -- Constraints are now elaborated as auto implicits (as one would expect)
|
|
|
|
81 | giveBack : {x : a} -> MyData x -> a -- (previously as explicit arguments of the interface
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2021-05-14 19:35:21 +03:00
|
|
|
Warning: We are about to implicitly bind the following lowercase names.
|
|
|
|
You may be unintentionally shadowing the associated global definitions:
|
|
|
|
a is shadowing Main.R2.R2.a, Main.R1.R1.a
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:76:1--81:38
|
|
|
|
76 | interface Show a => (num : Num a) => MyIface a where -- Some interface with
|
|
|
|
77 | constructor MkIface
|
|
|
|
78 | -- constraints
|
|
|
|
79 | data MyData : a -> Type -- and a data declaration.
|
|
|
|
80 | someFunc : a -> a -- Constraints are now elaborated as auto implicits (as one would expect)
|
|
|
|
81 | giveBack : {x : a} -> MyData x -> a -- (previously as explicit arguments of the interface
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2021-05-14 19:35:21 +03:00
|
|
|
Warning: We are about to implicitly bind the following lowercase names.
|
|
|
|
You may be unintentionally shadowing the associated global definitions:
|
|
|
|
a is shadowing Main.R2.R2.a, Main.R1.R1.a
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:85:1--86:37
|
|
|
|
85 | data MyDataImpl : a -> Type where -- implementation of MyData
|
|
|
|
86 | MkMyData : (x : a) -> MyDataImpl x
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2021-05-14 19:35:21 +03:00
|
|
|
Warning: We are about to implicitly bind the following lowercase names.
|
|
|
|
You may be unintentionally shadowing the associated global definitions:
|
|
|
|
a is shadowing Main.R2.R2.a, Main.R1.R1.a
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:86:3--86:11
|
|
|
|
82 | -- constructor)
|
|
|
|
83 |
|
|
|
|
84 |
|
|
|
|
85 | data MyDataImpl : a -> Type where -- implementation of MyData
|
|
|
|
86 | MkMyData : (x : a) -> MyDataImpl x
|
2021-10-03 12:15:01 +03:00
|
|
|
^^^^^^^^
|
|
|
|
|
2021-05-14 19:35:21 +03:00
|
|
|
Warning: We are about to implicitly bind the following lowercase names.
|
|
|
|
You may be unintentionally shadowing the associated global definitions:
|
|
|
|
a is shadowing Main.R2.R2.a, Main.R1.R1.a
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:112:1--112:11
|
|
|
|
108 | Show' String where
|
|
|
|
109 | show' = id
|
|
|
|
110 |
|
|
|
|
111 | %hint
|
|
|
|
112 | showMaybe' : Show' a => Show' (Maybe a)
|
2021-10-03 12:15:01 +03:00
|
|
|
^^^^^^^^^^
|
|
|
|
|
2021-05-14 19:35:21 +03:00
|
|
|
Warning: We are about to implicitly bind the following lowercase names.
|
|
|
|
You may be unintentionally shadowing the associated global definitions:
|
|
|
|
a is shadowing Main.R2.R2.a, Main.R1.R1.a
|
|
|
|
b is shadowing Main.Other.b
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:141:3--141:10
|
|
|
|
137 | setName : String -> OrdinaryDog -> OrdinaryDog
|
|
|
|
138 | setName name' = {name := name'}
|
|
|
|
139 |
|
|
|
|
140 | data Three : Type -> Type -> Type -> Type where
|
|
|
|
141 | MkThree : (x : a) -> (y : b) -> (z : c) -> Three a b c
|
2021-10-03 12:15:01 +03:00
|
|
|
^^^^^^^
|
|
|
|
|
2021-05-14 19:35:21 +03:00
|
|
|
Warning: We are about to implicitly bind the following lowercase names.
|
|
|
|
You may be unintentionally shadowing the associated global definitions:
|
|
|
|
a is shadowing Main.R2.R2.a, Main.R1.R1.a
|
|
|
|
b is shadowing Main.Other.b
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:143:1--143:10
|
|
|
|
139 |
|
|
|
|
140 | data Three : Type -> Type -> Type -> Type where
|
|
|
|
141 | MkThree : (x : a) -> (y : b) -> (z : c) -> Three a b c
|
|
|
|
142 |
|
|
|
|
143 | mapSetMap : (a -> a') -> b' -> (c -> c') -> Three a b c -> Three a' b' c'
|
2021-10-03 12:15:01 +03:00
|
|
|
^^^^^^^^^
|
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Warning: You may be unintentionally shadowing the following local bindings:
|
|
|
|
a
|
|
|
|
|
|
|
|
Fld:154:1--154:70
|
|
|
|
150 |
|
|
|
|
151 | --------- Applications in presence of duplicate names ----------
|
|
|
|
152 |
|
|
|
|
153 | -- Duplicate names are ok and treated sequentially
|
|
|
|
154 | testDuplicateNames : {auto a : String} -> {auto a : String} -> String
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
Warning: You may be unintentionally shadowing the following local bindings:
|
|
|
|
a
|
|
|
|
|
|
|
|
Fld:162:1--162:52
|
|
|
|
158 | -- a function on RHS
|
|
|
|
159 | -- unnamed arguments always take priority over named,
|
|
|
|
160 | -- i.e they are bound/applied first,
|
|
|
|
161 | -- regardless of their relative positions to named ones
|
|
|
|
162 | testOrder1 : (a : String) -> (a : String) -> String
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
Warning: You may be unintentionally shadowing the following local bindings:
|
|
|
|
a
|
|
|
|
|
|
|
|
Fld:176:1--176:57
|
|
|
|
172 | -- Two arguments with the same name can be successfully bound
|
|
|
|
173 | -- if one of them is renamed in patterns.
|
|
|
|
174 | -- As both arguments are requested by name
|
|
|
|
175 | -- They are bound in the same order they are given
|
|
|
|
176 | sameNamesOk : (a : String) -> (a : Nat) -> (String, Nat)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
Warning: You may be unintentionally shadowing the following local bindings:
|
|
|
|
aa
|
|
|
|
|
|
|
|
Fld:181:1--181:74
|
|
|
|
177 | sameNamesOk {a {- = a-}, a = b} = (a, b)
|
|
|
|
178 |
|
|
|
|
179 | -- All arguments are named and are of different `plicities`. Binds occur sequentially.
|
|
|
|
180 | -- Arguments are renamed on LHS
|
|
|
|
181 | eachArgType : (a : String) -> {a : String} -> {auto a : String} -> String
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2021-05-14 19:35:21 +03:00
|
|
|
Warning: We are about to implicitly bind the following lowercase names.
|
|
|
|
You may be unintentionally shadowing the associated global definitions:
|
|
|
|
a is shadowing Main.R2.R2.a, Main.R1.R1.a
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:219:15--219:21
|
|
|
|
215 | dontCare2 : (x : Nat) -> Nat -> Nat -> Nat -> (y : Nat) -> x + y = y + x
|
|
|
|
216 | dontCare2 {} = plusCommutative {}
|
|
|
|
217 | -- dontCare2 _ _ _ _ _ = plusCommutative _ _
|
|
|
|
218 |
|
|
|
|
219 | data Tree a = Leaf a | Node (Tree a) a (Tree a)
|
2021-10-03 12:15:01 +03:00
|
|
|
^^^^^^
|
|
|
|
|
2021-05-14 19:35:21 +03:00
|
|
|
Warning: We are about to implicitly bind the following lowercase names.
|
|
|
|
You may be unintentionally shadowing the associated global definitions:
|
|
|
|
a is shadowing Main.R2.R2.a, Main.R1.R1.a
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:219:24--219:48
|
|
|
|
215 | dontCare2 : (x : Nat) -> Nat -> Nat -> Nat -> (y : Nat) -> x + y = y + x
|
|
|
|
216 | dontCare2 {} = plusCommutative {}
|
|
|
|
217 | -- dontCare2 _ _ _ _ _ = plusCommutative _ _
|
|
|
|
218 |
|
|
|
|
219 | data Tree a = Leaf a | Node (Tree a) a (Tree a)
|
2021-10-03 12:15:01 +03:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2021-05-14 19:35:21 +03:00
|
|
|
Warning: We are about to implicitly bind the following lowercase names.
|
|
|
|
You may be unintentionally shadowing the associated global definitions:
|
|
|
|
a is shadowing Main.R2.R2.a, Main.R1.R1.a
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:221:1--221:7
|
|
|
|
217 | -- dontCare2 _ _ _ _ _ = plusCommutative _ _
|
2021-10-03 12:15:01 +03:00
|
|
|
218 |
|
2022-09-07 22:59:28 +03:00
|
|
|
219 | data Tree a = Leaf a | Node (Tree a) a (Tree a)
|
|
|
|
220 |
|
|
|
|
221 | isNode : Tree a -> Bool
|
2021-10-03 12:15:01 +03:00
|
|
|
^^^^^^
|
|
|
|
|
2021-05-14 19:35:21 +03:00
|
|
|
Warning: We are about to implicitly bind the following lowercase names.
|
|
|
|
You may be unintentionally shadowing the associated global definitions:
|
|
|
|
a is shadowing Main.R2.R2.a, Main.R1.R1.a
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:225:1--226:24
|
|
|
|
225 | data IsNode : Tree a -> Type where
|
|
|
|
226 | Is : IsNode (Node {})
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2021-05-14 19:35:21 +03:00
|
|
|
Warning: We are about to implicitly bind the following lowercase names.
|
|
|
|
You may be unintentionally shadowing the associated global definitions:
|
|
|
|
a is shadowing Main.R2.R2.a, Main.R1.R1.a
|
2021-10-03 12:15:01 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:228:1--228:10
|
|
|
|
224 |
|
|
|
|
225 | data IsNode : Tree a -> Type where
|
|
|
|
226 | Is : IsNode (Node {})
|
|
|
|
227 |
|
|
|
|
228 | decIsNode : (x : Tree a) -> Dec (IsNode x)
|
2021-10-03 12:15:01 +03:00
|
|
|
^^^^^^^^^
|
|
|
|
|
2020-12-03 15:28:20 +03:00
|
|
|
Error: While processing right hand side of r2_shouldNotTypecheck1. Ambiguous elaboration. Possible results:
|
|
|
|
Main.R2.MkR
|
2021-10-31 01:08:53 +03:00
|
|
|
Main.R1.MkR (Prelude.the Prelude.Nat 22)
|
2020-12-03 15:28:20 +03:00
|
|
|
|
2022-09-07 22:59:28 +03:00
|
|
|
Fld:74:26--74:29
|
|
|
|
70 | r1 : R1 -- explicit fields access
|
|
|
|
71 | r1 = MkR {field = "string"}
|
|
|
|
72 |
|
|
|
|
73 | r2_shouldNotTypecheck1 : ?
|
|
|
|
74 | r2_shouldNotTypecheck1 = MkR {field = the Nat 22} -- fail, impossible to disambiguate
|
2021-02-11 20:24:26 +03:00
|
|
|
^^^
|
2020-12-03 15:28:20 +03:00
|
|
|
|
|
|
|
Main> Main.myDog : OrdinaryDog
|
|
|
|
Main> Main.mySuperDog : SuperDog
|
|
|
|
Main> Main.other : Other String
|
2021-09-19 13:33:48 +03:00
|
|
|
Main> 1 hole: Main.r2_shouldNotTypecheck1 : ?_ [no locals in scope]
|
2020-12-03 15:28:20 +03:00
|
|
|
Main> Bye for now!
|