### [Haskell-cafe] Rank N Kinds

It was discussed a bit here: http://ghc.haskell.org/trac/ghc/ticket/8090 Rank N Kinds: Main Idea is: If we assume an infinite hierarchy of classifications, we have True :: Bool :: * :: ** :: *** :: :: ... Bool = False, True, ... * = Bool, Sting, Maybe Int, ... **= *,

### Re: [Haskell-cafe] Rank N Kinds

Yes, True :: Bool :: * :: ** :: *** :: :: ... in Haskell is the same as True :: Bool :: Set0 :: Set1 :: Set2 :: Set3 :: ... in Agda And I'm asking for useful examples for *** (Set2 in Agda) and higher cheers Wvv 28 Jul 2013 at 8:44:08, Schonwald [via Haskell] (ml-node

### Re: [Haskell-cafe] Rank N Kinds

(a::**) = Foo a data Bar (a::***) = Bar a So, now the task is more easy: I'm asking for useful examples with CloseKinds with ** and higher, and any useful examples for *** and higher cheers, Wvv 29 Jul 2013 at 14:44:50, JosÃ© Pedro MagalhÃ£es [via Haskell] (ml-node+s1045720n5733561...@n5.nabble.com) wrote

### Re: [Haskell-cafe] Rank N Kinds

fstTuppleL = fstL tupleL -- = 2 sndTuppleL :: String sndTuppleL = sndL tupleL -- = inside tuple tlTuppleL :: TupleList ( (String :: *) - (Bool :: *) ) tlTuppleL = tailL tupleL -- = TupleUnit inside tuple (TupleUnit True TupleNil)) cheers, Wvv 31 Jul 2013 at 22:48:19, Roman Cheplyaka-2 [via

### Re: [Haskell-cafe] Rank N Kinds

c{0}. Int- Bool - Bool h :: forrec c{1}. String - Bool - Bool h :: forrec c{2}. Bool - Bool - Bool P.S.S. All this staff is open for discussion )) cheers, Wvv -- View this message in context: http://haskell.1045720.n5.nabble.com/Rank-N-Kinds-tp5733482p5733699.html Sent

### Re: [Haskell-cafe] Rank N Kinds

I'm sorry, `instance Functor (TupleList (a :: **)) where ...` isn't right, sure. The right one is `instance Functor TupleList where ...` -- View this message in context: http://haskell.1045720.n5.nabble.com/Rank-N-Kinds-tp5733482p5733700.html Sent from the Haskell - Haskell-Cafe mailing list

### Re: [Haskell-cafe] Rank N Kinds

:: **) - (String :: **) ] t3 = [42 :: Int, (), This is true *** type ] :k t3 * head t3 42 :: Int (head $ tail t3) True True True :: Bool Wvv 2 Aug 2013 at 5:34:26, Daniel Peebles [via Haskell] (ml-node+s1045720n5733708...@n5.nabble.com) wrote: The higher universe levels are mostly used

### [Haskell-cafe] Proposal: Polymorphic typeclass and Records

Let we have data in one module as this: data Person = Person { personId :: Int, name :: String } data Address a = Address { personId :: Int, address :: String , way :: a} It was discussed a lot in topics OverloadedRecordFields This is an alternative: Let we have polymorphic

### Re: [Haskell-cafe] Proposal: Polymorphic typeclass and Records

Thanks! You do a great job! Adam Gundry wrote Haskell doesn't allow classes to be polymorphic in the names of their methods Yes, still not (( -- View this message in context: http://haskell.1045720.n5.nabble.com/Proposal-Polymorphic-typeclass-and-Records-tp5735096p5735365.html Sent from

### [Haskell-cafe] Proposal: Generic conditions for 'if' and 'case'

I think it is an old idea, but nevertheless. Now we have next functions: if (a :: Bool) then x else y case b of a1 :: Bool - x1 a2 :: Bool - x2 ... Let we have generic conditions for 'if' and 'case': class Boolean a where toBool :: a - Bool instance Boolean Bool where toBool = id

### Re: [Haskell-cafe] Proposal: Generic conditions for 'if' and 'case'

Thanks! It is a good toy for testing! Nicolas Trangez wrote Here's an example implementing your proposal: {-# LANGUAGE RebindableSyntax #-} import Prelude class Boolean a where toBool :: a - Bool instance Boolean Bool where toBool = id instance Boolean [a] where

### Re: [Haskell-cafe] Unary functions and infix notation

But we can do next: Prelude :set XPostfixOperators Prelude let z = (\y - True) :: a - Bool Prelude :t (True `z`) But still `z` True ~\a - a `z` True~ \a - z a True and `z` must be a function with minimum 2 arguments -- View this message in context:

### [Haskell-cafe] Proposal: Pragma EXPORT

I suggest to add instead of (or with) export section Pragma EXPORT: We have 3 values: public, abstract and private. Data(with newtypes and types,..) could be public, like `Data(...)` or abstract `Data`. Other cases abstract = public. {-# EXPORT smth #-} pragma is valid till next {-# EXPORT smth

### [Haskell-cafe] Why superclass' instances are bad idea?

I suggest to add superclass' instances into libraries. http://ghc.haskell.org/trac/ghc/ticket/8348 In brief, we could write next: {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} instance Monad m = Applicative m where pure = return (*) = ap instance

### Re: [Haskell-cafe] Why superclass' instances are bad idea?

Thanks a lot! This makes clear. I haven't noticed before that OverlappingInstances don't look at constraint! John Lato-2 wrote This line instance Monad m = Applicative m where tells the compiler Every type (of the appropriate kind) is an instance of Applicative. And it needs to have

### [Haskell-cafe] Proposal: RankedInstances

The main power of Haskell is on instances. But Haskell instances system work fine with lower number of instances (rare instances). But we want hight density of instances! If we wish to have more selective instances we use `OverlappingInstances` (which are desined in a poor way) and if we still

### Re: [Haskell-cafe] Proposal: new function for lifting

Which lift? This one? class MonadTrans t where lift :: Monad m = m a - t m a -- View this message in context: http://haskell.1045720.n5.nabble.com/Proposal-new-function-for-lifting-tp5737189p5737196.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

### [Haskell-cafe] Newclasses

Newclasses are not a new vision of classes! Not at all! Newclasses could elegant solve several instance problems! 1) we want to have partly applied instances, like Parent2Child: Parent a = Child a like instance Applicative m = Monad m where return = pure

### Re: [Haskell-cafe] Newclasses

Your first two cases will be fixed in 7.10, as Applicative finally becomes a superclass of Monad. Sure, newclassses not about Applicative and Monads only. This question is more wider. Must Apply be a superclass of Bind? Must Bind be a superclass of Monad? So, must Monad has 2 superclasses at

### Re: [Haskell-cafe] Newclasses

, Haskell would be the best language in nearest future!!! About the misfeature. If class is independent of superclass functions and can't check dependence's laws, why does it order to have instances of unnecessary class? Stijn van Drongelen wrote On Thu, Oct 3, 2013 at 8:16 AM, Wvv lt; vitea3v

### Re: [Haskell-cafe] Newclasses

a newclass is supposed to be. On Thu, Oct 3, 2013 at 2:15 PM, Wvv lt; vitea3v@ gt; wrote: newclass Bind a = Monad a = BMonad a where { (=) = (-) } I think this means that `BMonad` is supposed to be a new class that has both Bind and Monad in scope, the same as class (Bind a, Monad

### Re: [Haskell-cafe] Newclasses

Stijn van Drongelen wrote On Fri, Oct 4, 2013 at 10:31 PM, Wvv lt; vitea3v@ gt; wrote: About newclass and compose data, we can do next: newclass Foo [a] = FooList a where {containerMainipulation=...} newclass Foo (Set a) = FooSet a where {containerMainipulation=...} newclass