Skip to content

Instantly share code, notes, and snippets.

@paluh
Created August 30, 2022 15:41
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 paluh/54548cd80ae6e6ca908d49b84bc2e4ca to your computer and use it in GitHub Desktop.
Save paluh/54548cd80ae6e6ca908d49b84bc2e4ca to your computer and use it in GitHub Desktop.
Compact singature
module Main where
import Prelude
import Data.Foldable (fold)
import Data.Tuple.Nested (type (/\))
import Type.Prelude (Proxy(..))
import Effect (Effect)
import TryPureScript (h1, h2, p, text, list, indent, link, render, code)
class Compact a b c | a b -> c -- , c -> a b
instance Compact a a a
else instance Compact a b (a /\ b)
summary :: forall a b c. Compact a b c => Proxy a -> Proxy b -> Proxy c
summary _ _ = Proxy
x = summary (Proxy :: Proxy String) (Proxy :: Proxy String)
y = summary (Proxy :: Proxy String) (Proxy :: Proxy Int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment