Comments (2)
Polymorphism is hard because of the t
in ConcST t
. See the wip branch:
/home/barrucadu/projects/coco/examples/ComplexStack.hs:54:7: error:
• No instance for (Data.Typeable.Internal.Typeable t)
arising from a use of ‘lit’
• In the expression:
lit "pushLS" (pushLS :: A -> LockStack (ConcST t) A -> ConcST t ())
In the ‘expressions’ field of a record
In the expression:
Sig
{initialState = fromListLS,
expressions = [lit
"pushLS" (pushLS :: A -> LockStack (ConcST t) A -> ConcST t ()),
lit
"popLS" (popLS :: LockStack (ConcST t) A -> ConcST t (Maybe A)),
lit
"peekLS" (peekLS :: LockStack (ConcST t) A -> ConcST t (Maybe A)),
....],
backgroundExpressions = [lit
"whenJust"
((\ f s -> maybe (pure ()) (`f` s)) ::
(A -> LockStack (ConcST t) A -> ConcST t ())
-> LockStack (ConcST t) A -> Maybe A -> ConcST t ()),
commLit
"|||" ((|||) :: ConcST t A -> ConcST t B -> ConcST t ())],
observation = const . toListLS, backToSeed = const . toListLS,
setState = \ (LockStack v) -> modifyMVar_ v . const . pure}
Polymorphism for everything without a nested ConcST t
(ConcST t A
is fine) is entirely feasible, but less impressive.
from coco.
wip branch now looking a lot more healthy after the type refactor.
from coco.
Related Issues (12)
- Infer hole types automatically HOT 1
- Add stateVar to background expressions automatically HOT 1
- Term rewriting for pure subschemas HOT 1
- De-couple seed and interference types
- Conditional equations
- s/boring/neutral
- List neutral schemas
- Polymorphic let/bind HOT 1
- Merge type environments by unification, not equality HOT 1
- An arbitrary number of type variables HOT 1
- Refinement symbol
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 coco.