import { Iso , Lens , Prism , Optional , Traversal , Getter , Fold , Setter } from '../../src' ; import * as assert from 'assert' ; type U0 = true ; type U1 = false ; const anIso = new Iso < U0 , U1 > ( ( ) => false , ( ) => true ) ; const hasType = < T > ( _ ) : void => assert ( true ) ; describe ( 'Conversions' , ( ) => { it ( 'type check' , ( ) => { const isoLens = anIso . asLens ( ) ; const isoPrism = anIso . asPrism ( ) ; const isoOptional = anIso . asOptional ( ) ; const isoTraversal = anIso . asTraversal ( ) ; const isoGetter = anIso . asGetter ( ) ; hasType < Fold < U0 , U1 > > ( anIso . asFold ( ) ) ; hasType < Setter < U0 , U1 > > ( anIso . asSetter ( ) ) ; hasType < Optional < U0 , U1 > > ( isoLens . asOptional ( ) ) ; hasType < Traversal < U0 , U1 > > ( isoLens . asTraversal ( ) ) ; hasType < Getter < U0 , U1 > > ( isoLens . asGetter ( ) ) ; hasType < Fold < U0 , U1 > > ( isoLens . asFold ( ) ) ; hasType < Setter < U0 , U1 > > ( isoLens . asSetter ( ) ) ; hasType < Optional < U0 , U1 > > ( isoPrism . asOptional ( ) ) ; hasType < Traversal < U0 , U1 > > ( isoPrism . asTraversal ( ) ) ; hasType < Fold < U0 , U1 > > ( isoPrism . asFold ( ) ) ; hasType < Setter < U0 , U1 > > ( isoPrism . asSetter ( ) ) ; hasType < Traversal < U0 , U1 > > ( isoOptional . asTraversal ( ) ) ; hasType < Fold < U0 , U1 > > ( isoOptional . asFold ( ) ) ; hasType < Setter < U0 , U1 > > ( isoOptional . asSetter ( ) ) ; hasType < Fold < U0 , U1 > > ( isoTraversal . asFold ( ) ) ; hasType < Setter < U0 , U1 > > ( isoTraversal . asSetter ( ) ) ; hasType < Fold < U0 , U1 > > ( isoGetter . asFold ( ) ) ; } ) ; } ) ;