Skip to content

Instantly share code, notes, and snippets.

@zraffer
Last active July 25, 2019 16:48
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 zraffer/f13cdf3da1fff8aa8f251542fc9ccea7 to your computer and use it in GitHub Desktop.
Save zraffer/f13cdf3da1fff8aa8f251542fc9ccea7 to your computer and use it in GitHub Desktop.
{-# OPTIONS --without-K --safe --no-sized-types --no-guardedness #-}
module Agda.Builtin.FromString where
open import Agda.Primitive
open import Agda.Builtin.String
record IsString {a} (A : Set a) : Set (lsuc a) where
field
Constraint : String → Set a
fromString : (s : String) {{_ : Constraint s}} → A
open IsString {{...}} public using (fromString)
{-# BUILTIN FROMSTRING fromString #-}
{-# DISPLAY IsString.fromString _ s = fromString s #-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment