fix is:module

Monadic fixpoints. For a detailed discussion, see Levent Erkok's thesis, Value Recursion in Monadic Computations, Oregon Graduate Institute, 2002.
Fixed points of a functor. Type f should be a Functor if you want to use simple recursion schemes or Traversable if you want to use monadic recursion schemes. This style allows you to express recursive functions in non-recursive manner. You can imagine that a non-recursive function holds values of the previous iteration. An example: First we define a base functor. The arguments b are recursion points.
>>> data ListF a b = Nil | Cons a b deriving (Show, Functor)
The list is then a fixed point of ListF
>>> type List a = Fix (ListF a)
We can write length function. Note that the function we give to foldFix is not recursive. Instead the results of recursive calls are in b positions, and we need to deal only with one layer of the structure.
>>> :{
let length :: List a -> Int
length = foldFix $ \x -> case x of
Nil      -> 0
Cons _ n -> n + 1
:}
If you already have recursive type, like '[Int]', you can first convert it to `Fix (ListF a)` and then foldFix. Alternatively you can use recursion-schemes combinators which work directly on recursive types.
Monadic fixpoints. For a detailed discussion, see Levent Erkok's thesis, Value Recursion in Monadic Computations, Oregon Graduate Institute, 2002.
This module defines a Fixed type for working with fixed-point arithmetic. Fixed-point arithmetic represents fractional numbers with a fixed number of digits for their fractional part. This is different to the behaviour of the floating-point number types Float and Double, because the number of digits of the fractional part of Float and Double numbers depends on the size of the number. Fixed point arithmetic is frequently used in financial mathematics, where they are used for representing decimal currencies. The type Fixed is used for fixed-point fractional numbers, which are internally represented as an Integer. The type Fixed takes one parameter, which should implement the typeclass HasResolution, to specify the number of digits of the fractional part. This module provides instances of the HasResolution typeclass for arbitrary typelevel natural numbers, and for some canonical important fixed-point representations. This module also contains generalisations of div, mod, and divMod to work with any Real instance. Automatic conversion between different Fixed can be performed through realToFrac, bear in mind that converting to a fixed with a smaller resolution will truncate the number, losing information.
>>> realToFrac (0.123456 :: Pico) :: Milli
0.123
Fixity
Fixity information to give the parser so that infix operators can be parsed properly.
A container which allows you to position widgets at fixed coordinates
Various fixups in the introspection data.
Provides TextShow instance for Fixed, as well as the showbFixed function. Since: 2
Word with fixed length lists constructed from NonEmpty and Empty types.
Fixed point numbers. They are implemented as ratios with fixed denominator. Many routines fail for some arguments. When they work, they can be useful for obtaining approximations of some constants. We have not paid attention to rounding errors and thus some of the trailing digits may be wrong.
GtkFixed places its child widgets at fixed positions and with fixed sizes. GtkFixed performs no automatic layout management. For most applications, you should not use this container! It keeps you from having to learn about the other GTK containers, but it results in broken applications. With GtkFixed, the following things will result in truncated text, overlapping widgets, and other display bugs:
  • Themes, which may change widget sizes.
  • Fonts other than the one you used to write the app will of course change the size of widgets containing text; keep in mind that users may use a larger font because of difficulty reading the default, or they may be using a different OS that provides different fonts.
  • Translation of text into other languages changes its size. Also, display of non-English text will use a different font in many cases.
In addition, GtkFixed does not pay attention to text direction and thus may produce unwanted results if your app is run under right-to-left languages such as Hebrew or Arabic. That is: normally GTK will order containers appropriately for the text direction, e.g. to put labels to the right of the thing they label when using an RTL language, but it can’t do that with GtkFixed. So if you need to reorder widgets depending on the text direction, you would need to manually detect it and adjust child positions accordingly. Finally, fixed positioning makes it kind of annoying to add/remove UI elements, since you have to reposition all the other elements. This is a long-term maintenance problem for your application. If you know none of these things are an issue for your application, and prefer the simplicity of GtkFixed, by all means use the widget. But you should be aware of the tradeoffs.