quantified-constraints Questions
1
Solved
Previously, in order to use quantified constraints on typeclasses like Ord, you had to include the superclass in the instance like so:
newtype A f = A (f Int)
deriving instance (forall a. Eq a =>...
Milliliter asked 27/8, 2021 at 15:51
3
Solved
Consider the following code, which typechecks:
module Scratch where
import GHC.Exts
ensure :: forall c x. c => x -> x
ensure = id
type Eq2 t = (forall x y. (Eq x, Eq y) => Eq (t x y) ::...
Sky asked 20/7, 2020 at 8:40
0
Why is it that the following code:
class TheClass (t :: * -> * -> *)
where
type TheFamily t :: * -> Constraint
data Dict (c :: Constraint)
where
Dict :: c => Dict c
foo :: forall ...
Ooze asked 20/7, 2020 at 6:2
2
I am trying to use this blogpost's approach to higher-kinded data without dangling Identity functors for the trival case together with quantified-constraint deriving:
{-# LANGUAGE TypeFamilies #-}...
Postulate asked 6/6, 2019 at 3:38
1
Solved
With quantified constraints I can derive Eq (A f) just fine? However, when I try to derive Ord (A f) it fails. I do not understand how to use quantified constraints when the constraint class has a ...
Kampala asked 14/1, 2020 at 23:20
1
Solved
I'm playing around with a multikinded tagless encoding of Free
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUA...
Biblio asked 13/6, 2019 at 4:36
3
I'm trying to write something that appears to be analagous to "rank 2 types", but for constraints instead. (Or, maybe it's not correct to assume changing -> in the definition of "rank 2 types" t...
Interlocutrix asked 10/11, 2011 at 6:30
1
© 2022 - 2024 — McMap. All rights reserved.