Git Product home page Git Product logo

Comments (5)

Hodapp87 avatar Hodapp87 commented on June 22, 2024

I do, and this is the error:

src/Ivory/Language/Coroutine.hs:49:27:
    Couldn't match type ‘s10’ with ‘s1’
      ‘s10’ is untouchable
        inside the constraints (ClearBreak eff ~ ProcEffects s2 ())
        bound by the type of the constructor ‘CoroutineBody’:
                   (ClearBreak eff ~ ProcEffects s2 ()) => Ivory eff (Ref s10 a)
        at src/Ivory/Language/Coroutine.hs:49:27
      ‘s1’ is a rigid type variable bound by
           the type of the constructor ‘CoroutineBody’:
             (forall (eff :: Effects).
              (ClearBreak eff ~ ProcEffects s2 ()) =>
              Ivory eff (Ref s1 a))
             -> Ivory (ProcEffects s2 ()) ()
           at src/Ivory/Language/Coroutine.hs:49:27
    Expected type: Ivory eff (Ref s10 a)
      Actual type: Ivory eff (Ref s1 a)
    In the ambiguity check for the type of the constructor ‘CoroutineBody’:
      CoroutineBody :: forall (s1 :: Ivory.Language.Scope.RefScope) s2.
                       (forall (eff :: Effects).
                        (ClearBreak eff ~ ProcEffects s2 ()) =>
                        Ivory eff (Ref s1 a))
                       -> Ivory (ProcEffects s2 ()) ()
    To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
    In the definition of data constructor ‘CoroutineBody’
    In the newtype declaration for ‘CoroutineBody’
src/Ivory/Language/Coroutine.hs:49:27:
    Couldn't match type ‘s10’ with ‘s1’
      ‘s10’ is untouchable
        inside the constraints (ClearBreak eff ~ ProcEffects s2 ())
        bound by the type of the constructor ‘CoroutineBody’:
                   (ClearBreak eff ~ ProcEffects s2 ()) => Ivory eff (Ref s10 a)
        at src/Ivory/Language/Coroutine.hs:49:27
      ‘s1’ is a rigid type variable bound by
           the type of the constructor ‘CoroutineBody’:
             (forall (eff :: Effects).
              (ClearBreak eff ~ ProcEffects s2 ()) =>
              Ivory eff (Ref s1 a))
             -> Ivory (ProcEffects s2 ()) ()
           at src/Ivory/Language/Coroutine.hs:49:27
    Expected type: Ivory eff (Ref s10 a)
      Actual type: Ivory eff (Ref s1 a)
    In the ambiguity check for the type of the constructor ‘CoroutineBody’:
      CoroutineBody :: forall (a :: Area *).
                       (forall (s1 :: Ivory.Language.Scope.RefScope) s2.
                        (forall (eff :: Effects).
                         (ClearBreak eff ~ ProcEffects s2 ()) =>
                         Ivory eff (Ref s1 a))
                        -> Ivory (ProcEffects s2 ()) ())
                       -> CoroutineBody a
    To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
    In the definition of data constructor ‘CoroutineBody’
    In the newtype declaration for ‘CoroutineBody’

from ivory.

jameysharp avatar jameysharp commented on June 22, 2024

Oh, I think maybe I see it. Does it work without ambiguous types if CoroutineBody looks something like this instead? (Not tested, just off the top of my head.)

newtype CoroutineBody a = CoroutineBody (forall s1 s2. (forall b. Ivory (Effects (Returns ()) b s2) (Ref s1 a)) -> Ivory (ProcEffects s2 ()) ())

That's supposed to say that the yield callback can be used whether break statements are allowed or not, but must be used in the same allocation scope as the current coroutine.

from ivory.

Hodapp87 avatar Hodapp87 commented on June 22, 2024

Okay. That built after I turned

(Effects (Returns ()) b s2)

to

('Effects (Returns ()) b (Scope s2))

I'll do a pull request on this.

from ivory.

pchickey avatar pchickey commented on June 22, 2024

Thanks very much for fixing this, Chris!

I'm a little embarrassed that everyone over here at Galois is too lazy to install GHC 7.10 and figure this out ourselves, but we're very heads down on other stuff for another month or two.

from ivory.

Hodapp87 avatar Hodapp87 commented on June 22, 2024

You're welcome @pchickey - and no problem. I figured I'd devote a few minutes to it since I'm already working with GHC 7.10 and Ivory nearly every day - and that's about all it took to fix it.

from ivory.

Related Issues (20)

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.