Shabloinker
Shabloinker

Reputation: 361

Unexpected parallel statement in a list comprehension Haskell

I am getting this error, I'm trying to implement a bloom filter

Unexpected parallel statement in a list comprehension
Use ParallelListComp

from this line of code below

addDB db idx = (last z) where z = db:[ setTrue  udb i  | udb <- z | i <- idx ]

Any ideas?

Upvotes: 6

Views: 5078

Answers (2)

Shabloinker
Shabloinker

Reputation: 361

Just needed to add

{-# LANGUAGE ParallelListComp #-}

Thanks for pointing that out bheklilr

Upvotes: 13

G Philip
G Philip

Reputation: 565

Did you really mean to use a parallel list comprehension there? To quote the Haskell 2010 Report, a (normal) list comprehension has the form [e | q_1, ..., q_n] where each qualifier q_i is either a generator of the form p <- e, a local binding, or a boolean guard. If you intended one of these, you should use a comma and not a pipe to separate the qualifiers in your list comprehension.

Upvotes: 4

Related Questions