# Seq

### From HaskellWiki

The `seq` function is the most basic method of introducing strictness to a Haskll program. `seq :: a -> b -> b` takes two arguments of any type, and returns the second. However, it also has the important property that it is magically strict in its first argument. In essence, `seq` is defined by the following two equations:

⊥ `seq` b = ⊥ a `seq` b = b

A common misconception regarding `seq` is that `seq x` "evaluates" `x`. Well, sort of. `seq` doesn't evaluate anything just by virtue of existing in the source file. All it does is introduce an artificial dependency of one value on another: when the result of `seq` is evaluated, the first argument must also be evaluated. As an example, suppose `x :: Integer`, then `seq x b` is essentially a bit like `if x == 0 then b else b` - unconditionally equal to `b`, but forcing `x` along the way. In particular, the expression `x `seq` x` is completely redundant, and always has exactly the same effect as just writing `x`.

*is*the case that evaluating

*then*

*only*way to force evaluation of a value with a function type.