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, ...
**= *, *->B
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
kNKinds we could write:
data Foo (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 H
ool :: *) )
tupleL = TupleUnit 5 (TupleUnit "inside tuple" (TupleUnit True TupleNil)))
fstTuppleL :: Int
fstTuppleL = fstL tupleL -- = 2
sndTuppleL :: String
sndTuppleL = sndL tupleL -- = "inside tuple"
tlTuppleL :: TupleList ( (String :: *) -> (Bool :: *) )
tlTuppleL = tail
g :: forrec c{1}. String -> String
g = ("Hello " ++)
g :: forrec c{2}. Bool -> Bool
g = (True &&)
And now it is possible to write signatures to `tmap` and `fmap`
tmap :: forany i. forrec{i} a b c c' c''. c@( (a -> b) :: **) { -> c }
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 ar
ool -> Bool :: **) -> (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.co
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
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 fr
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
in
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]
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:
http://haskell.
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 #-} pragma is valid till next {-# EXPORT #-}.
We
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
>
>i
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
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 hav
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.
_
"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
> 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 o
endent 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 <
> vitea3v@
> > wrote:
>
>> > Your first two cases will be fixed in
Thu, Oct 3, 2013 at 7:53 PM, John Lato <
> jwlato@
> > wrote:
>
>> I don't really understand what a "newclass" is supposed to be.
>>
>>
>> On Thu, Oct 3, 2013 at 2:15 PM, Wvv <
> vitea3v@
> > wrote:
>>
>>>
>>>
Stijn van Drongelen wrote
> On Fri, Oct 4, 2013 at 10:31 PM, Wvv <
> vitea3v@
> > wrote:
>> About newclass and compose data, we can do next:
>>
>>newclass Foo [a] => FooList a where {containerMainipulation=...}
>>
>>newclass Foo (
22 matches
Mail list logo