This code is from Learn you a haskell book.

```
class Tofu t where
tofu :: j a -> t a j
data Frank a b = Frank { frankField :: b a }
deriving (Show)
instance Tofu Frank where
tofu x = Frank x
```

Also I've seen similar code where type parameter and data parameter are reversed like

```
data SomeData a b = SomeData { field1 :: b a }
```

Why are they written like that?

# Best How To :

The order of type parameters is almost immaterial. The one place where it's not immaterial is that often the last parameters are imbued meaning by typeclasses.

The most common example of this is that if you want to instantiate a type variable as the one that "gets `fmap`

ped over" it must come last. This has to do with the definition of the class

```
class Functor f where
fmap :: (a -> b) -> f a -> f b
```

where you see that `f`

has its *last* parameter as the one transformed by the function. We could define another one which does the second-to-last parameter slot

```
class Functor2 f where
fmap2 :: (a -> b) -> f a x -> f b x
```

and so on and so forth.

Outside of meaning imbued for reasons like this, however, there is no meaning behind parameter ordering.