Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 865
Shabloinker Avatar asked Apr 16 '15 01:04

Shabloinker


2 Answers

Just needed to add

{-# LANGUAGE ParallelListComp #-}

Thanks for pointing that out bheklilr

like image 96
Shabloinker Avatar answered Nov 07 '22 20:11

Shabloinker


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.

like image 34
G Philip Avatar answered Nov 07 '22 20:11

G Philip