| Branch: | Tag: | Revision:

root / htools / Ganeti / BasicTypes.hs @ cefd4a4a

History | View | Annotate | Download (6.8 kB)

# Date Author Comment
139c0683 11/30/2012 03:54 pm Iustin Pop

Remove read instances from our Haskell code

It turns out that optimising 'read' derived instances (via -O) for
complex data types (like OpCode, or the various objects) can be slow
to very slow. Disabling such instances results in (time make
$all_our_haskell_binaries) large compile-time savings and also smaller...

7413b229 11/12/2012 12:02 pm Iustin Pop

Move and rename BasicTypes.annotateIOError

It turns out that annotateIOError already exists in the standard
library, with a different purpose (this made me waste 10 minutes
trying to understand why the types were wrong…). Let's move this out
of BasicTypes, since it's used only in Daemon.hs, and also rename it....

98508e7f 10/19/2012 06:04 pm Dato Simó

BasicTypes.hs: fix docstring for eitherToResult

eitherToResult now converts from `Either a b` to `GenericResult`, not
necessarily from `Either String` only. Also, fix a typo.

Signed-off-by: Dato Simó <>
Reviewed-by: Iustin Pop <>

93be1ced 10/17/2012 07:53 pm Iustin Pop

Generalise the Result type

Currently, our error monad—Result—has a plain string error type. This
is not good, as we don't have structured errors, we can't pass back
proper error information to Python code, etc.

To solve this, we generalise this type as 'GenericResult a', and make...

274366e5 09/28/2012 12:27 pm Agata Murawska

Realign instances of typeclasses

As per Iustin's suggestion, this patch aligns parts of typeclass
instance on "=".

Signed-off-by: Agata Murawska <>
Reviewed-by: Iustin Pop <>

d71fbcc5 09/26/2012 07:34 pm Agata Murawska

Create ResulT for monad transformations

This patch creates ResultT, a monad transformation used later in
RPC <-> query integration.

Signed-off-by: Agata Murawska <>
Reviewed-by: Iustin Pop <>

25779212 09/04/2012 01:59 pm Iustin Pop

Add an Applicative instance for our Result type

This will allow us to run generic computations in an Applicative
context, if a monadic one is not needed (or not applicable due to
class constraints).

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

a9ccc950 08/28/2012 06:01 pm Iustin Pop

Add a Functor instance for our Result type

This will allow us to use the simpler applicative form (<$>, <*>)
instead of monadic liftM, liftM2, etc.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

2fc5653f 07/19/2012 11:00 am Iustin Pop

Reorganise the lookup functions

Currently, the LookupResult, MatchPriority and related functions are
locate in Loader.hs, since (so far) only hbal needs them in the
selection of instances. However, with the new functionality on confd
side, we need these functions there too, but we don't want to import...

88a10df5 03/22/2012 07:30 pm Iustin Pop

Rework exit model

While updating the confd code, I realised that we have lots of
duplication in the exit model for the various programs.

So this patch attempts to abstract all the exits via a couple of new
functions; sorry for the somewhat big patch, but I hope the payoff is...

1091021c 03/21/2012 12:25 am Iustin Pop

Add two utility functions

These both are work with/on the Result type, so we add them to
BasicTypes. The functions will be used as more generic versions of
some more specialised functions that are right now spread across the

Signed-off-by: Iustin Pop <>...

f3f76ccc 01/13/2012 03:16 pm Iustin Pop

More reshuffling of code

Following the split Types/BasicTypes, we can remove the last
JSON-related stuff from Utils.hs, and do some more cleanup.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

0c37d1e4 01/13/2012 03:15 pm Iustin Pop

htools: split parts of HTools/Types.hs into BasicTypes.hs

The 'Result' type is common and:

- might be used outside of HTools-specific code too
- is better split as we need these basic types for building the more
complex ones in Types.hs

Signed-off-by: Iustin Pop <>...