[m-rev.] for review: discrete interval encoding tree

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Mar 3 13:44:30 AEDT 2014



On Mon, 3 Mar 2014 13:15:27 +1100, Peter Wang <novalazy at gmail.com> wrote:
> > > +%-----------------------------------------------------------------------------%
> > > +
> > > +:- func det_from_int(int) = T <= enum(T).
> > > +
> > > +det_from_int(I) = X :-
> > > +    ( X0 = from_int(I) ->
> > > +        X = X0
> > > +    ;
> > > +        unexpected($module, $pred, "from_int failed")
> > > +    ).
> > 
> > Move this to the enum module.
> 
> Are you sure?  I think enum should stay minimal.

I agree with Julien. I think this is definitely something that many users of enums
would want.

Zoltan.






More information about the reviews mailing list