Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell. Why is :info (:) returns the definition twice?

I'm new to haskell.

If I type in GHCi (7.10.3):

:info (:)

I get result:

*** Parser:
data [] a = ... | a : [a]   -- Defined in ‘GHC.Types’
infixr 5 :

data [] a = ... | a : [a]   -- Defined in ‘GHC.Types’
infixr 5 :

Does it means that operator is defined twice? I didn't find any suspicious things in the source =/

like image 306
user1201917 Avatar asked Mar 07 '16 23:03

user1201917


1 Answers

Pay no attention to this, it's certainly a bug. I can reproduce this behavior on GHC 7.10.3, but the current GHC 8.0 development snapshot doesn't suffer from this issue:

GHCi, version 8.0.0.20160316: http://www.haskell.org/ghc/  :? for help
Prelude> :info (:)
data [] a = ... | a : [a]   -- Defined in ‘GHC.Types’
infixr 5 :
like image 172
int_index Avatar answered Nov 07 '22 01:11

int_index