Re: Defining a wired-in type of a different kind

2019-04-04 Thread Richard Eisenberg
Hi Jan, mkAlgTyCon is good for making an algebraic datatype -- like Maybe or Bool or Either. It's not what you want for RNil, which is really a data constructor. Instead, rowKindCon should be the algebraic datatype, and RNil should be one of its constructors. Then you get the RNil TyCon via

Re: Defining a wired-in type of a different kind

2019-04-03 Thread Matthew Pickering
I would suggest that it's easier to define a normal type constructor and data cons and then promote them. This is how the runtime rep polymorphism stuff works for instance so you can look there for inspiration (it's where I look to work out how to implement multiplicity polymorphism). Matt On

Re: Defining a wired-in type of a different kind

2019-04-03 Thread Jan van Brügge
I did, see here: https://gitlab.haskell.org/jvanbruegge/ghc/blob/73b383275f3d497338ca50a3a7934445c3858450/compiler/prelude/TysWiredIn.hs#L235 Am 03.04.19 um 16:28 schrieb Simon Peyton Jones: > > Make sure you add the new wired in this to `TysWiredIn.wiredInTyCons` > >   > > *From:*ghc-devs *On

RE: Defining a wired-in type of a different kind

2019-04-03 Thread Simon Peyton Jones via ghc-devs
Make sure you add the new wired in this to `TysWiredIn.wiredInTyCons` From: ghc-devs On Behalf Of Jan van Brügge Sent: 03 April 2019 12:06 To: ghc-devs@haskell.org Subject: Defining a wired-in type of a different kind Hi, when trying to get familiar with the GHC code base for my Bachelor's

Re: Defining a wired-in type of a different kind

2019-04-03 Thread Jan van Brügge
Yeah, sorry, it is here: https://gitlab.haskell.org/jvanbruegge/ghc/commit/73b383275f3d497338ca50a3a7934445c3858450 Am 03.04.19 um 13:11 schrieb Ben Gamari: > On April 3, 2019 7:06:11 AM EDT, "Jan van Brügge" wrote: >> Hi, >> >> when trying to get familiar with the GHC code base for my

Re: Defining a wired-in type of a different kind

2019-04-03 Thread Ben Gamari
On April 3, 2019 7:06:11 AM EDT, "Jan van Brügge" wrote: >Hi, > >when trying to get familiar with the GHC code base for my Bachelor's >thesis. I followed the GHC Wiki, especially the case study about the >bool type. >Now I wanted to add a new kind and a new type inhabiting this kind >(without

Defining a wired-in type of a different kind

2019-04-03 Thread Jan van Brügge
Hi, when trying to get familiar with the GHC code base for my Bachelor's thesis. I followed the GHC Wiki, especially the case study about the bool type. Now I wanted to add a new kind and a new type inhabiting this kind (without having to expose a data constructor, so without datatype promotion).