Hi,
In similar situations, especially if there is more than one useful way to
use the various parts of an algorithm, I used often prefer existentials:
data Model = forall markup table alignments. Model
{
prepareData :: Data () - Data markup,
initialize :: Data
Von: Hal Daume III
Hi,
In similar situations, especially if there is more than one
useful way to
use the various parts of an algorithm, I used often prefer existentials:
data Model = forall markup table alignments. Model
{
prepareData :: Data () - Data markup,
Hi all,
I'm looking for some advice on what's the cleanest way to implement
something. The basic idea is that I have a task to solve, T. There are
many steps to solving this task, but they can be broken down into a small
list of elementary steps:
- prepareData
- initialize
- doThingOne
On Thu, Aug 01, 2002 at 02:34:00PM -0700, Hal Daume III wrote:
...
Now, I want in my executable my user to be able to say -model=0 and so
on in the command line and for it to use the appropriate model. Each of
these models will go in a separate module.
One way to do this would be to
One way to do this would be to import all of the models qualified and then
if they choose Model0, pass to the go function Model0.prepareData,
Model0.initialize, etc. This is fine, simple, good. But it doesn't
enforce at all the types of the functions.
I don't understand what you mean
Hal Daume III writes:
| Hi all,
|
| I'm looking for some advice on what's the cleanest way to implement
| something.
:
| where the main driver does something like:
|
| prepareData
| initialize
| iterate until converged
| doThingOne
| doThingTwo
| getResults
|
|
Hal Daume III writes:
Hi all,
I'm looking for some advice on what's the cleanest way to implement
something. The basic idea is that I have a task to solve, T. There are
many steps to solving this task, but they can be broken down into a small
list of elementary steps:
- prepareData