Heres my code:
print 1: [2,3]
When I run it I get
Cannot unify type
Data.List.List
with type
Prim.Array
Whats going on?
[2, 3] has type Array Int. (:) has type a -> List a -> List a in Data.List. You need to convert to a List. Also, what you have will parse as
(print 1) : [2, 3]
I think you want
print (1 : toList [2, 3])
or
print $ 1 : toList [2, 3]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With