Closed basile-henry closed 6 years ago
@FintanH I mainly followed the code structure from Functor, it does look nicer as you suggested though :+1:
Did I understand correctly that the new structure for package.dhall
is just a lambda returning the record like for Applicative?
Is package.dhall
something that is often used in Dhall projects? I don't have much experience using Dhall myself, just very interested in its development, is there any code structure most Dhall project adhere to?
Good spot with Functor/package.dhall
– we should trim that down. Must have gotten overlooked before.
And yeah, package.dhall
is a convention from @Gabriel439 that exposes a directory as a single record. In dhall-bhat, that often provides a single place to specify common type parameters for the operations.
This PR implements Issue #25 by adding:
Bifunctor
typeclass usingbimap
for definitionfirst
andsecond
defined in terms ofbimap
Bifunctor
instance for theEither
typeHere is an example:
The order of the type arguments for
bimap
follow the naming used in Haskell'sbimap
as opposed to using the one used in themapBoth
definition. If this is an issue, I'd be more than happy to change that. :smile: