Comments (5)
What's the type of innerFuncDummy
? Can you please provide a self-contained file.
from idris2.
What's the type of
innerFuncDummy
? Can you please provide a self-contained file.
Hi! Thanks so much for your response. The self-contained file is linked at the very top, I will put it here again: https://github.com/Lichborne/IdrisLinearityIssue/blob/main/ErrorExamples.idr
innerFuncDummy is a dummy function : AbstractInterface t => (i : Nat) -> (m: Nat) -> LVect i Nat -@ LStateT (t m) (t m) (LVect i Nat), that is;
innerFuncDummy : AbstractInterface t => (i : Nat) -> (m: Nat) -> LVect i Nat -@ LStateT (t m) (t m) (LVect i Nat)
innerFuncDummy 0 m any = pure any
innerFuncDummy (S k) m (q::qs) = pure (q::qs)
In the real-life scenario, there is a function here that actually does something, which is why this is included, but in this case it's just lifting to the right context.
Hope this helps.
from idris2.
innerFuncDummy
takes three arguments. The first two are (i : Nat)
and (m: Nat)
but you
used the names i
and n
to refer to them. Consequently qs
is typechecked as if it were the
m
argument, which has an unrestricted quantity. Hence the error.
Writing innerFuncDummy {i = (S k), m = m} qs
instead, I'm not sure why I still get the error.
Ditching the named application style entirely, innerFuncDummy (S k) m qs
gives us a different error:
Can't find an implementation for AbstractInterface ?t.
Moving on to innerFuncDummy {t} (S k) m qs
as t
cannot be solved gives us
Can't find an implementation for AbstractInterface t.
Adding a AbstractInterface t =>
constraint to the type of doubleLayerFunc
we get code that
works.
There seems to be an issue with the way named application is elaborated.
from idris2.
Dear gallais,
Thanks so much! Hope I did not waste your time.
Best,
Lichborne
from idris2.
Not at all, there does seem to be a bug hiding behind the non-bug of the shrunken case.
Thanks for taking the time to submit a self-contained reproducer, sorry I did not notice it
upon first read.
from idris2.
Related Issues (20)
- Type information is lost/changed when inlining a function (and it's not clear why) HOT 5
- Inconsistency in totality checker with different constants values and representations
- A proof of Void HOT 1
- Compiler runs indefinitely for namespaced functions if named arguments are wrong
- Bad semantic highlighting on lambda with parenthesis
- [ preformance ] implementation of `unpack` is inefficient
- Open `Data.Vect.nubBy` for compile-time proofs HOT 1
- [ perf ] type-level evalutaion of `Prelude.elem` is slow compared to the naïve implementation
- Is it safe to pass a GC'ed pointer to C?
- Underscore name of an implicit argument in a signature of an interface function does not work
- Chez backend is too naive on the value of `CHEZ` environment variable
- unification failure between if then else statements when using isYes (decEq n a) as the condition HOT 2
- Add error message with missing fixity namespace
- Execution and compilation hangs indefintely HOT 3
- Loading file in ide-mode changes working directory and causes errors on later actions
- Make output of ide-mode `:interpret` consistent to always return consistent datatype (String)
- Inconsistent error message when finding more than one implementation of an interface
- Reconstructing a (structurally smaller) aggregate from pattern-matched components trips up the totality checker HOT 8
- Support type annotations on LHS of a monadic bind `<-` HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from idris2.