package monocle.function
import monocle.std.tuple2._
import monocle.{Iso, Lens}
import scala.annotation.implicitNotFound
@implicitNotFound("Could not find an instance of Cons1[${S}, ${H}, ${T}], please check Monocle instance location policy to " +
"find out which import is necessary")
trait Cons1[S, H, T] extends Serializable {
def cons1: Iso[S, (H, T)]
def head: Lens[S, H] = cons1 composeLens first
def tail: Lens[S, T] = cons1 composeLens second
}
object Cons1 extends HConsFunctions
trait HConsFunctions {
final def cons1[S, H, T](implicit ev: Cons1[S, H, T]): Iso[S, (H, T)] = ev.cons1
final def head[S, H, T](implicit ev: Cons1[S, H, T]): Lens[S, H] = ev.head
final def tail[S, H, T](implicit ev: Cons1[S, H, T]): Lens[S, T] = ev.tail
final def _cons1[S, H, T](head: H, tail: T)(implicit ev: Cons1[S, H, T]): S =
ev.cons1.reverseGet((head, tail))
final def _uncons1[S, H, T](s: S)(implicit ev: Cons1[S, H, T]): (H, T) =
ev.cons1.get(s)
}