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 highercheers Wvv
28 Jul 2013 at 8:44:08, Schonwald [via Haskell] ([hidden email]) wrote:
hello Wvv,a lot of these ideas have been explored before in related (albeit "simpler") languages to haskell, are you familiar with idris, coq, or agda?
cheers-Carter
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
If you reply to this email, your message will be added to the discussion below:http://haskell.1045720.n5.nabble.com/Rank-N-Kinds-tp5733482p5733510.html
First useful use is in Typeable.
In GHC 7.8
class Typeable (a::k) where ... <<==>> class Typeable (a ::**) where ...
But we can't write
data Foo (a::k)->(a::k)->* ... deriving Typeable
OMG!
I still have 7.6.3. It has old Typeable.
I misunderstood PolyKinds a bit. It looks like k /= **, k ~ *******...
But we cannot use "CloseKinds" like
data Foo (a::k) = Foo a -- catch an error "Expected kind `OpenKind', but `a' has kind `k'"
with RankNKinds 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 Haskell] ([hidden email]) wrote:
Hi,
On Fri, Jul 26, 2013 at 10:42 PM, Wvv <[hidden email]> wrote:First useful use is in Typeable.
In GHC 7.8
class Typeable (a::k) where ... <<==>> class Typeable (a ::**) where ...
But we can't write
data Foo (a::k)->(a::k)->* ... deriving Typeable
Why not? This works fine in 7.7, as far as I know.
Cheers,
Pedro
How about this, I found it bt myself:
data TupleList (t :: **) = TupleNil | TupleUnit t (TupleList t)
fstL :: TupleList (a -> **) -> a
fstL TupleNil = error "TupleList2 is TupleNil"
fstL (TupleUnit a _ ) = a
sndL :: TupleList (* -> a -> **) -> a
sndL TupleNil = error "TupleList2 is TupleNil"
sndL (TupleUnit a TupleNil ) = error "TupleList2 is TupleUnit a TupleNil"
sndL (TupleUnit _ (TupleUnit a _ ) ) = a
headL :: TupleList (a -> **) -> a
headL TupleNil = error "TupleList2 is TupleNil"
headL (TupleUnit a _ ) = a
tailL :: TupleList (* -> a) -> a
tailL TupleNil = error "TupleList2 is TupleNil"
tailL (TupleUnit _ a ) = a
instance Functor (TupleList (a :: **)) where
fmap _ TupleNil = TupleNil
fmap f (TupleUnit x xs) = TupleUnit (f x) (fmap xs)
tupleL :: TupleList ( (Int :: *) -> (String :: *) -> (Bool :: *) )
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 = tailL tupleL -- = TupleUnit "inside tuple" (TupleUnit True TupleNil))
cheers, Wvv
31 Jul 2013 at 22:48:19, Roman Cheplyaka-2 [via Haskell] ([hidden email]) wrote:
That's because types that belong to most non-star kinds cannot have
values.
data Foo (a :: k) = Foo
is okay,
data Foo (a :: k) = Foo a
is bad because there cannot be a field of type a :: k.
So no, no useful examples exist, because you wouldn't be able to use
such a data constructor even if you could declare it.
Roman
* Wvv <[hidden email]> [2013-07-31 11:40:17-0700]
> OMG!
> I still have 7.6.3. It has old Typeable.
>
> I misunderstood PolyKinds a bit. It looks like k /= **, k ~ *******...
>
> But we cannot use "CloseKinds" like
>
> data Foo (a::k) = Foo a -- catch an error "Expected kind `OpenKind', but `a' has
> kind `k'"
>
>
> with RankNKinds 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 Haskell]
> ([hidden email]) wrote:
>
> Hi,
>
> On Fri, Jul 26, 2013 at 10:42 PM, Wvv <[hidden email]> wrote:
>
> First useful use is in Typeable.
> In GHC 7.8
> class Typeable (a::k) where ... <<==>> class Typeable (a ::**) where ...
>
> But we can't write
> data Foo (a::k)->(a::k)->* ... deriving Typeable
>
>
> Why not? This works fine in 7.7, as far as I know.
>
>
> Cheers,
> Pedro
>
>
>
>
> --
> View this message in context: http://haskell.1045720.n5.nabble.com/Rank-N-Kinds-tp5733482p5733667.html
> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Paradoxes there are at logic and math. At programing languages we have bugs or features :))
Higher universe levels are needed first of all for more abstract programming.
P.S. By the way, we don't need have extra TupleList, we have already list!
t3 :: [ (Int :: **) -> (Bool ->
Bool
->
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] ([hidden email]) wrote:
The higher universe levels are mostly "used" to stave off logical paradoxes in languages where you care about that kind of stuff. In a fundamentally impredicative language like Haskell I don't see much point, but I'd be happy to find there is one :)
On Thu, Aug 1, 2013 at 4:55 PM, Wvv <[hidden email]> wrote:The right one is `instance Functor TupleList where ...`