:: a -> ()

Reduce to weak head normal form Equivalent to \x -> seq x (). Useful for defining NFData for types for which NF=WHNF holds.
data T = C1 | C2 | C3
instance NFData T where rnf = rwhnf
Reduce to weak head normal form Equivalent to \x -> seq x (). Useful for defining NFData for types for which NF=WHNF holds.
data T = C1 | C2 | C3
instance NFData T where rnf = rwhnf
Reduce to weak head normal form Equivalent to \x -> seqX x (). Useful for defining rnfX for types for which NF=WHNF holds.
Function to be used as third argument in inferIxSet when you don't want any calculated values.
The function unsafeCoerce# allows you to side-step the typechecker entirely. That is, it allows you to coerce any type into any other type. If you use this function, you had better get it right, otherwise segmentation faults await. It is generally used when you want to write a program that you know is well-typed, but where Haskell's type system is not expressive enough to prove that it is well typed. The following uses of unsafeCoerce# are supposed to work (i.e. not lead to spurious compile-time or run-time crashes):
  • Casting any lifted type to Any
  • Casting Any back to the real type
  • Casting an unboxed type to another unboxed type of the same size. (Casting between floating-point and integral types does not work. See the GHC.Float module for functions to do work.)
  • Casting between two types that have the same runtime representation. One case is when the two types differ only in "phantom" type parameters, for example Ptr Int to Ptr Float, or [Int] to [Float] when the list is known to be empty. Also, a newtype of a type T has the same representation at runtime as T.
Other uses of unsafeCoerce# are undefined. In particular, you should not use unsafeCoerce# to cast a T to an algebraic data type D, unless T is also an algebraic data type. For example, do not cast Int->Int to Bool, even if you later cast that Bool back to Int->Int before applying it. The reasons have to do with GHC's internal representation details (for the cognoscenti, data values can be entered but function closures cannot). If you want a safe type to cast things to, use Any, which is not an algebraic data type. Warning: this can fail with an unchecked exception.
The function unsafeCoerce# allows you to side-step the typechecker entirely. That is, it allows you to coerce any type into any other type. If you use this function, you had better get it right, otherwise segmentation faults await. It is generally used when you want to write a program that you know is well-typed, but where Haskell's type system is not expressive enough to prove that it is well typed. The following uses of unsafeCoerce# are supposed to work (i.e. not lead to spurious compile-time or run-time crashes):
  • Casting any lifted type to Any
  • Casting Any back to the real type
  • Casting an unboxed type to another unboxed type of the same size. (Casting between floating-point and integral types does not work. See the GHC.Float module for functions to do work.)
  • Casting between two types that have the same runtime representation. One case is when the two types differ only in "phantom" type parameters, for example Ptr Int to Ptr Float, or [Int] to [Float] when the list is known to be empty. Also, a newtype of a type T has the same representation at runtime as T.
Other uses of unsafeCoerce# are undefined. In particular, you should not use unsafeCoerce# to cast a T to an algebraic data type D, unless T is also an algebraic data type. For example, do not cast Int->Int to Bool, even if you later cast that Bool back to Int->Int before applying it. The reasons have to do with GHC's internal representation details (for the cognoscenti, data values can be entered but function closures cannot). If you want a safe type to cast things to, use Any, which is not an algebraic data type. Warning: this can fail with an unchecked exception.
toFields provides a convenient typeclass wrapper around the Field_ creation functions in Opaleye.SqlTypes. Besides convenience it doesn't provide any additional functionality. It can be used with functions like runInsert to insert custom Haskell types into the database. The following is an example of a function for inserting custom types.
customInsert
:: ( Default ToFields haskells fields )
=> Connection
-> Table fields fields'
-> haskells
-> IO Int64
customInsert conn table haskells = runInsert conn table $ toFields haskells
In order to use this function with your custom types, you need to define an instance of Default ToFields for your custom types.
Do not use. Use toFields instead. Will be deprecated in version 0.7.
Compute the number of segments of anything measured by SegMeasure (e.g. SegMeasure itself, Segment, SegTree, Trails...)
Euclidean norm of a vector.
Sadness.
Convert a value to a readable string type supported by ConvertString using the Show instance.