:type null null :: [a] -> Bool In Frege: frege> :type null Emp...">

Why is ": type null" different from Frege from Haskell?

In Haskell:

ghci> :type null
null :: [a] -> Bool

In Frege:

frege> :type null
Empty α => α β -> Bool

How to interpret this answer and why is there a difference?

(a real-world example of haskell adapted in the real world by frege git repo)

+4
source share
1 answer

Since it is Stringnot [Char]in Frege, some (perhaps half) attempts were made, however, guarantee a certain level of compatibility behind the scenes:

  • The type of the class Emptymakes it possible to test for an empty value ( null) (probably it should be a subclass of Monoid)
  • Class type ListLikegives you headand tailand(++)
  • ListSource , ( toList). String, Maybe . , [a], ListSource .

, , , Haskell, Frege.

: , null, (++), head, tail , , Frege.

+5

All Articles