dropWhile_1.hs

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:00.0
disk size 630 Bytes
downloadable true
type
attribute value
name no_type
processor id 1
description this is the default benchmark type for rejected benchmarks and benchmarks that are not associated with a type.
owning community none
loading contents
{-# htermination (dropWhile :: (a  ->  MyBool)  ->  (List a)  ->  (List a)) #-} 
import qualified Prelude 
data MyBool = MyTrue | MyFalse 
data List a = Cons a (List a) | Nil 
dropWhile0 p vv vw MyTrue = Cons vv vw;

otherwise :: MyBool;
otherwise = MyTrue;

dropWhile1 p vv vw MyTrue = dropWhile p vw;
dropWhile1 p vv vw MyFalse = dropWhile0 p vv vw otherwise;

dropWhile2 p (Cons vv vw) = dropWhile1 p vv vw (p vv);

dropWhile3 p Nil = Nil;
dropWhile3 vz wu = dropWhile2 vz wu;

dropWhile :: (a  ->  MyBool)  ->  (List a)  ->  (List a);
dropWhile p Nil = dropWhile3 p Nil;
dropWhile p (Cons vv vw) = dropWhile2 p (Cons vv vw);

popout

content may be truncated. 'popout' for larger text window.

actions get anonymous link download benchmark