[Haskell-cafe] naturally, length :: a -> Int

Sylvain Henry sylvain at haskus.fr
Tue Mar 2 16:02:23 UTC 2021


On 01/03/2021 17:45, Johannes Waldmann wrote:
> Dear Cafe -
>
>
> let's fight Int.

I'm in too.

One first step would be to use `Word#` instead of `Int#` in ghc primops 
where it makes sense. This could be done as it should be transparent to 
most users.

The natural next step would be to modify functions and classes in `base` 
to use appropriate types too. I don't think it's going to happen as it 
would require modifying the Haskell report and breaking almost every 
existing code/books/etc.

So an alternative path would be to extract every wired-in things from 
`base` and to put them into a `ghc-base` package that `base`, 
`foundation` and other alternative preludes would depend on. This way we 
could write codes that don't depend on `base` and the legacy stuff it 
contains at all (even transitively).

Could you open a ticket on GHC's bug tracker about this?

Cheers,
Sylvain



More information about the Haskell-Cafe mailing list