0 | module Data.Refined.String
2 | import public Data.Refined.Char
3 | import public Data.Refined.List
4 | import public Data.Refined.Core
9 | 0 Len : (p : Integer -> Type) -> String -> Type
10 | Len p = p `On` cast . prim__strLength
13 | 0 Str : (p : List Char -> Type) -> String -> Type
14 | Str p = p `On` unpack
19 | data LeftTrimmed : List Char -> Type where
23 | -> Holds (Prelude.not . Prelude.isControl) c
24 | -> LeftTrimmed (c :: cs)
27 | HDec0 (List Char) LeftTrimmed where
28 | hdec0 (c::_) = map LTCons $
hdec0 c
32 | HDec (List Char) LeftTrimmed where
33 | hdec (c::_) = map LTCons $
hdec c
38 | data RightTrimmed : List Char -> Type where
41 | -> Holds (Prelude.not . Prelude.isControl) c
47 | -> RightTrimmed (c :: cs)
50 | HDec0 (List Char) RightTrimmed where
51 | hdec0 [c] = map RT1 $
hdec0 c
52 | hdec0 (c::cs) = map RTCons $
hdec0 cs
56 | HDec (List Char) RightTrimmed where
57 | hdec [c] = map RT1 $
hdec c
58 | hdec (c::cs) = map RTCons $
hdec cs
62 | 0 Trimmed : List Char -> Type
63 | Trimmed = LeftTrimmed && RightTrimmed