Skip to content

Instantly share code, notes, and snippets.

@hgiasac
Created January 4, 2019 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hgiasac/89e165a50bbbdb7f35421bcdbe0c127d to your computer and use it in GitHub Desktop.
Save hgiasac/89e165a50bbbdb7f35421bcdbe0c127d to your computer and use it in GitHub Desktop.
dynApply :: Dynamic -> Dynamic -> Maybe Dynamic
dynApply (Dyn (TrApp (TrApp tr targ) tres) fun) (Dyn targ' arg)
| Just HRefl <- eqT tr (typeRep :: TypeRep (->))
, Just HRefl <- eqT targ targ'
= Just (Dyn tres (fun arg))
dynApply _ _ = Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment