import { flow } from 'fp-ts/function' ; import { match , Option } from 'fp-ts/Option' ; interface User { readonly username : string ; } declare const queryByUsername ; interface HttpResponse < T > { readonly code : number ; readonly body : T ; } export const getByUsername = flow ( queryByUsername , match ( ( ) => ( { code : 404 , body : 'User not found.' } ) , ( user ) => ( { code : 200 , body : user } ) ) ) ;