[Haskell-cafe] New-bee question about seq in Parsec.Pos

Ketil Malde ketil+haskell at ii.uib.no
Mon Jul 4 05:08:23 EDT 2005


Christoph Bauer <ich at christoph-bauer.net> writes:

> data SourcePos      = SourcePos SourceName !Line !Column
> 		     deriving (Eq,Ord)

> My poor haskell knowledge says me, that Line and Column is
> always strict. 

Yes.

> So, what does the following function?

> forcePos :: SourcePos -> SourcePos      
> forcePos pos@(SourcePos name line column) = seq line (seq column (pos))

AFAICT, nothing.  My guess would be that it's an oversight (for
instance, it could be a remnant from a prevoius version where the data
type was non-strict).  Is 'forcePos' used much in the code?

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants



More information about the Haskell-Cafe mailing list