Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phadej/free-applicative-agda
Free applicatives in agda
https://github.com/phadej/free-applicative-agda
Last synced: about 7 hours ago
JSON representation
Free applicatives in agda
- Host: GitHub
- URL: https://github.com/phadej/free-applicative-agda
- Owner: phadej
- Created: 2014-07-15T13:27:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-23T11:05:50.000Z (almost 10 years ago)
- Last Synced: 2024-10-11T23:53:32.189Z (26 days ago)
- Language: Agda
- Size: 148 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.agda
Awesome Lists containing this project
README
module README where
-- Free applicatives and related
-- Defined as in Haskell's free package
--
-- Harder to define in Agda
-- Easier to reason about, if you want to prove some facts
import Free-- More dynamic languages like definition
--
-- Applicative functor is functor from monoidal category to another together
-- with natural transformation η (pure) and morphism φ : F A × F B → F (A × B)
--
-- As product (×) is monoid operation, it is natural to "remember" φ using
-- free monoid structure, i.e. list.
--
-- Though in this case we need heterogenous list, it is easy with dependent types.
--
-- Not requiring F to be functor itself, is quite natural. We use similar
-- construction as with Coyoneda. We could use the fact F is a functor, but
-- using this fact will only make implementation more complex.
--
--
-- Definition is very natural after machinery is introduced
-- Yet proving anything (e.g. interchange or composition law) about this variant
-- is tedious
import Monoidal-- Which is (kind of) extension of Coyoneda from kan-extensions package
import Coyoneda-- And we are using own definition of well-founded recursion in Free module
-- More universe polymorphism, we can define recursive functions using measures
-- IMHO more flexible than sized-types.
import WellFounded