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.
Monad transformer for evaluating to a fixpoint. The idea is that some transforms need to be run multiple times. Deciding whether to run a transform again can be somewhat tedious though, as you cannot necessarily just run some transform f on x until f x == x. This might not be ideal for a few reasons:
  • x might not implement Eq;
  • x might implement Eq, but could contain floats of NaN, in which case NaN /= NaN; or
  • checking equality can be expensive.
Instead, this provides a function called progress, with the same type as return, that marks the current transform as having "made progress": that is, it should be re-run again. Then you can call fixpoint with a function of type a -> FixT m a, which will be re-run until no progress is made.
This module defines a "Fixed" type for fixed-precision arithmetic. The parameter to Fixed is any type that's an instance of HasResolution. HasResolution has a single method that gives the resolution of the Fixed type. This module also contains generalisations of div, mod, and divMod to work with any Real instance.
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
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.
GtkFixedLayout is a layout manager which can place child widgets at fixed positions. Most applications should never use this layout manager; fixed positioning and sizing requires constant recalculations on where children need to be positioned and sized. Other layout managers perform this kind of work internally so that application developers don't need to do it. Specifically, widgets positioned in a fixed layout manager will need to take into account:
  • 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, GtkFixedLayout 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 depending on the text direction, e.g. to put labels to the right of the thing they label when using an RTL language; GtkFixedLayout won't be able to do that for you. 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.
GtkLayoutChild subclass for children in a GtkFixedLayout.