More type safety on string types?
This commit is contained in:
		@@ -29,18 +29,18 @@ data Field a where
 | 
			
		||||
  Title :: Field String
 | 
			
		||||
 | 
			
		||||
data QueryF f where
 | 
			
		||||
  StartsWith :: Field a -> a -> QueryF f
 | 
			
		||||
  EndsWith :: Field a -> a -> QueryF f
 | 
			
		||||
  StartsWith :: Field String -> String -> QueryF f
 | 
			
		||||
  EndsWith :: Field String -> String -> QueryF f
 | 
			
		||||
  And :: f -> f -> QueryF f
 | 
			
		||||
 | 
			
		||||
deriving instance Functor QueryF
 | 
			
		||||
 | 
			
		||||
type Query = Fix QueryF
 | 
			
		||||
 | 
			
		||||
startsWith :: Field a -> a -> Query
 | 
			
		||||
startsWith :: Field String -> String -> Query
 | 
			
		||||
startsWith field x = Fix (StartsWith field x)
 | 
			
		||||
 | 
			
		||||
endsWith :: Field a -> a -> Query
 | 
			
		||||
endsWith :: Field String -> String -> Query
 | 
			
		||||
endsWith field x = Fix (EndsWith field x)
 | 
			
		||||
 | 
			
		||||
(.&&.) :: Query -> Query -> Query
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user