Git Product home page Git Product logo

Comments (2)

barrucadu avatar barrucadu commented on June 24, 2024

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.

barrucadu avatar barrucadu commented on June 24, 2024

wip branch now looking a lot more healthy after the type refactor.

from coco.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.