Re: [Haskell-cafe] Newclasses

2013-10-05 Thread Wvv
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

Re: [Haskell-cafe] Newclasses

2013-10-04 Thread Wvv
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

2013-10-03 Thread Wvv
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

2013-10-03 Thread Wvv
, 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

[Haskell-cafe] Newclasses

2013-10-02 Thread Wvv
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] Proposal: new function for lifting

2013-09-27 Thread Wvv
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.

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

2013-09-26 Thread Wvv
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

2013-09-26 Thread Wvv
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

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

2013-09-24 Thread Wvv
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

[Haskell-cafe] Proposal: Pragma EXPORT

2013-09-16 Thread Wvv
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

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

2013-09-06 Thread Wvv
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:

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

2013-09-02 Thread Wvv
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] Proposal: Polymorphic typeclass and Records

2013-09-01 Thread Wvv
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'

2013-09-01 Thread Wvv
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

[Haskell-cafe] Proposal: Polymorphic typeclass and Records

2013-08-28 Thread Wvv
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] Rank N Kinds

2013-08-10 Thread Wvv
:: **) - (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

Re: [Haskell-cafe] Rank N Kinds

2013-08-01 Thread Wvv
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

2013-08-01 Thread Wvv
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

2013-07-31 Thread Wvv
(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

2013-07-31 Thread Wvv
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

2013-07-28 Thread Wvv
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

[Haskell-cafe] Rank N Kinds

2013-07-26 Thread Wvv
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, ... **= *,