[Haskell-beginners] How to link two Types

PICCA Frederic-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Wed Feb 22 17:19:10 UTC 2017


Hello, I am affected by this error

src/Hkl/Xrd/OneD.hs:238:49-52:
    Could not deduce (Key a ~ Key b0)
    from the context (Frame a)
      bound by the type signature for
                 getPoniExtRef :: Frame a => XRDRef (Key a) -> IO PoniExt
      at src/Hkl/Xrd/OneD.hs:235:18-56
    NB: `Key' is a type function, and may not be injective
    The type variable `b0' is ambiguous
    Possible fix: add a type signature that fixes these type variable(s)
    Expected type: Nxs (Key b0)
      Actual type: Nxs (Key a)
    In the second argument of `withDataFrameH5', namely nxs'
    In the first argument of `(>->)', namely
      `withDataFrameH5 h5file nxs' (gen output f) yield'
    In the first argument of `toListM', namely
      `(withDataFrameH5 h5file nxs' (gen output f) yield
        >-> hoist lift (frames' [idx]))'


I looked at this

http://stackoverflow.com/questions/20870432/type-family-vs-data-family-in-brief-haskell#20908500

So in your opinion it would be better to use a data family instead of a type familly ?



Cheers


More information about the Beginners mailing list