A failwith is fine.


On Wed, Nov 6, 2013 at 11:47 AM, Spiros Eliopoulos <notifications@github.com
> wrote:

> In lib/Dehop.ml:
>
> > +(* These assume linear pols *)
> > +let rec separate_i p = match p with
> > +  | Seq(Star _, p) -> Filter True
> > +  | Seq(p,q) -> Seq(p, separate_i q)
> > +  | _ -> p
> > +
> > +let rec separate_t_from_pt p = match p with
> > +  | Seq(p, Link (sw,pt,sw',pt')) -> Link (sw,pt,sw',pt')
> > +  | Seq(p, Par (q,r)) -> Par (q,r)
> > +  | Seq(p, q) -> separate_t_from_pt q
> > +  | Link _ -> p
> > +  | Filter True -> p
> > +  | Filter False -> p
> > +  | _ -> failwith (Printf.sprintf "unexpected t pol: %s" (string_of_policy p))
> > +
> > +let rec separate_p_from_pt p = match p with
>
> I'm getting the following compiler warning:
>
> File "lib/Dehop.ml", line 967, characters 31-160:
> Warning 8: this pattern-matching is not exhaustive.
> Here is an example of a value that is not matched:
> (Mod (_, _)|Par (_, _)|Choice (_, _)|Star _|Link (_, _, _, _))
>
> Is there an appropriate catch-all for this?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/frenetic-lang/frenetic/pull/128/files#r7469633>
> .
>