[GHC] #11349: [TypeApplications] Create Proxy-free alternatives of functions in base

GHC ghc-devs at haskell.org
Tue Jan 5 15:57:42 UTC 2016


#11349: [TypeApplications] Create Proxy-free alternatives of functions in base
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Core Libraries    |              Version:  7.10.3
      Resolution:                    |             Keywords:
                                     |  TypeApplications
Operating System:  Other             |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 To get the ball rolling I suggest prefixing them with {in?,}definite
 articles:

 {{{#!hs
   aNat :: forall n. KnownNat n => Natural
 theNat :: forall n. KnownNat n => Natural

   aSymbol :: forall s. KnownSymbol s => String
 theSymbol :: forall s. KnownSymbol s => String

   aTypeRep :: forall t. Typeable t => TypeRep
 theTypeRep :: forall t. Typeable t => TypeRep

 theSizeOf :: forall s. Storable s => Int
 theSizeOf = sizeOf @s undefined
 }}}

 For the '''''T'''angent '''o'''f '''t'''he '''D'''ay'' ('''''a'''s '''a'''
 '''S'''ervice'') (''TotD''(''aaS'')), how should the inclusion of Natural
 in base influence functions and other libraries?

 Functions like `length`, `take`, `drop`, `splitAt`, `replicate` scream for
 natural numbers as their arguments: Their types are of course well
 established, `Int` is also fixed- while `Natural` is arbitrary-precision.
 Is `Word` suitable? Maybe not worth it.

 Lens defines `instance FunctorWithIndex Int []` whose functional
 dependency forbids indexing lists by (arguably more ‘natural’) `Natural`
 or `Word`. Changing them retroactively is a pain, but does it make sense
 in a perfect world?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11349#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list