0

Recently, I've been doing automatic testing with Haskell and QuickCheck. Some time I have got some fails, but the program retrieved [(),()] as checked argument.

What does "[(),()]" mean?

fant0me
  • 201
  • 1
  • 3
  • 15

1 Answers1

6

That's a list of two () (or "unit") values.

Prelude> :t [(),()]
[(),()] :: [()]
Prelude> :info ()
data () = ()    -- Defined in ‘GHC.Tuple’

A list is not an array; an array is flat, with constant-time indexing. A list is a nested recursive type.

jberryman
  • 16,334
  • 5
  • 42
  • 83