{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE AllowAmbiguousTypes #-}

module Pandora.Paradigm.Structure.Some.Splay where

import Pandora.Core.Functor (type (~>), type (:.), type (:=))
import Pandora.Pattern.Semigroupoid ((.))
import Pandora.Pattern.Category (($), (#))
import Pandora.Pattern.Functor.Covariant (Covariant ((-<$>-)))
import Pandora.Pattern.Functor.Bindable (Bindable ((=<<)))
import Pandora.Paradigm.Primary ()
import Pandora.Paradigm.Primary.Algebraic ((-<*>-), extract)
import Pandora.Paradigm.Primary.Algebraic.Product (twosome)
import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just))
import Pandora.Paradigm.Primary.Functor.Tagged (type (:#))
import Pandora.Paradigm.Primary.Functor.Wye (Wye (Left, Right))
import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct), deconstruct)
import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, unite)
import Pandora.Paradigm.Inventory.Optics (over)
import Pandora.Paradigm.Schemes (TU (TU), type (<:.>))
import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), Morph (Rotate, Into), premorph, rotate, into)
import Pandora.Paradigm.Structure.Ability.Nonempty (Nonempty)
import Pandora.Paradigm.Structure.Ability.Substructure (sub)
import Pandora.Paradigm.Structure.Some.Binary (Binary)

data Splay a = Zig a | Zag a

instance Morphable (Rotate (Left Zig)) Binary where
	type Morphing (Rotate (Left Zig)) Binary = Binary
	morphing :: (<:.>) (Tagged ('Rotate ('Left 'Zig))) Binary a
-> Morphing ('Rotate ('Left 'Zig)) Binary a
morphing ((<:.>) (Tagged ('Rotate ('Left 'Zig))) Binary a -> Binary a
forall k (mod :: k) (struct :: * -> *).
Morphable mod struct =>
(Tagged mod <:.> struct) ~> struct
premorph -> Binary a
binary) = ((Maybe :. Construction Wye) := a) -> Binary a
forall (t :: * -> *) a. Interpreted t => Primary t a -> t a
unite (((Maybe :. Construction Wye) := a) -> Binary a)
-> ((Maybe :. Construction Wye) := a) -> Binary a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
$ Binary a -> (Maybe :. Construction Wye) := a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run (Binary a -> (Maybe :. Construction Wye) := a)
-> (Construction Wye a -> Binary a)
-> Construction Wye a
-> (Maybe :. Construction Wye) := a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
forall (struct :: * -> *).
Morphable ('Rotate ('Left 'Zig)) struct =>
struct ~> Morphing ('Rotate ('Left 'Zig)) struct
rotate @(Left Zig) (Construction Wye a -> (Maybe :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<< Binary a -> Primary Binary a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run Binary a
binary

instance Morphable (Rotate (Right Zig)) Binary where
	type Morphing (Rotate (Right Zig)) Binary = Binary
	morphing :: (<:.>) (Tagged ('Rotate ('Right 'Zig))) Binary a
-> Morphing ('Rotate ('Right 'Zig)) Binary a
morphing ((<:.>) (Tagged ('Rotate ('Right 'Zig))) Binary a -> Binary a
forall k (mod :: k) (struct :: * -> *).
Morphable mod struct =>
(Tagged mod <:.> struct) ~> struct
premorph -> Binary a
binary) = ((Maybe :. Construction Wye) := a) -> Binary a
forall (t :: * -> *) a. Interpreted t => Primary t a -> t a
unite (((Maybe :. Construction Wye) := a) -> Binary a)
-> ((Maybe :. Construction Wye) := a) -> Binary a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
$ Binary a -> (Maybe :. Construction Wye) := a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run (Binary a -> (Maybe :. Construction Wye) := a)
-> (Construction Wye a -> Binary a)
-> Construction Wye a
-> (Maybe :. Construction Wye) := a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
forall (struct :: * -> *).
Morphable ('Rotate ('Right 'Zig)) struct =>
struct ~> Morphing ('Rotate ('Right 'Zig)) struct
rotate @(Right Zig) (Construction Wye a -> (Maybe :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<< Binary a -> Primary Binary a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run Binary a
binary

instance Morphable (Rotate (Left (Zig Zig))) Binary where
	type Morphing (Rotate (Left (Zig Zig))) Binary = Binary
	morphing :: (<:.>) (Tagged ('Rotate ('Left ('Zig 'Zig)))) Binary a
-> Morphing ('Rotate ('Left ('Zig 'Zig))) Binary a
morphing ((<:.>) (Tagged ('Rotate ('Left ('Zig 'Zig)))) Binary a -> Binary a
forall k (mod :: k) (struct :: * -> *).
Morphable mod struct =>
(Tagged mod <:.> struct) ~> struct
premorph -> Binary a
binary) = ((Maybe :. Construction Wye) := a) -> Binary a
forall (t :: * -> *) a. Interpreted t => Primary t a -> t a
unite (((Maybe :. Construction Wye) := a) -> Binary a)
-> ((Maybe :. Construction Wye) := a) -> Binary a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
$ Binary a -> (Maybe :. Construction Wye) := a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run (Binary a -> (Maybe :. Construction Wye) := a)
-> (Construction Wye a -> Binary a)
-> Construction Wye a
-> (Maybe :. Construction Wye) := a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
forall (struct :: * -> *).
Morphable ('Rotate ('Left ('Zig 'Zig))) struct =>
struct ~> Morphing ('Rotate ('Left ('Zig 'Zig))) struct
rotate @(Left (Zig Zig)) (Construction Wye a -> (Maybe :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<< Binary a -> Primary Binary a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run Binary a
binary

instance Morphable (Rotate (Right (Zig Zig))) Binary where
	type Morphing (Rotate (Right (Zig Zig))) Binary = Binary
	morphing :: (<:.>) (Tagged ('Rotate ('Right ('Zig 'Zig)))) Binary a
-> Morphing ('Rotate ('Right ('Zig 'Zig))) Binary a
morphing ((<:.>) (Tagged ('Rotate ('Right ('Zig 'Zig)))) Binary a -> Binary a
forall k (mod :: k) (struct :: * -> *).
Morphable mod struct =>
(Tagged mod <:.> struct) ~> struct
premorph -> Binary a
binary) = ((Maybe :. Construction Wye) := a) -> Binary a
forall (t :: * -> *) a. Interpreted t => Primary t a -> t a
unite (((Maybe :. Construction Wye) := a) -> Binary a)
-> ((Maybe :. Construction Wye) := a) -> Binary a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
$ Binary a -> (Maybe :. Construction Wye) := a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run (Binary a -> (Maybe :. Construction Wye) := a)
-> (Construction Wye a -> Binary a)
-> Construction Wye a
-> (Maybe :. Construction Wye) := a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
forall (struct :: * -> *).
Morphable ('Rotate ('Right ('Zig 'Zig))) struct =>
struct ~> Morphing ('Rotate ('Right ('Zig 'Zig))) struct
rotate @(Right (Zig Zig)) (Construction Wye a -> (Maybe :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<< Binary a -> Primary Binary a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run Binary a
binary

instance Morphable (Rotate (Left (Zig Zag))) Binary where
	type Morphing (Rotate (Left (Zig Zag))) Binary = Binary
	morphing :: (<:.>) (Tagged ('Rotate ('Left ('Zig 'Zag)))) Binary a
-> Morphing ('Rotate ('Left ('Zig 'Zag))) Binary a
morphing ((<:.>) (Tagged ('Rotate ('Left ('Zig 'Zag)))) Binary a -> Binary a
forall k (mod :: k) (struct :: * -> *).
Morphable mod struct =>
(Tagged mod <:.> struct) ~> struct
premorph -> Binary a
binary) = ((Maybe :. Construction Wye) := a) -> Binary a
forall (t :: * -> *) a. Interpreted t => Primary t a -> t a
unite (((Maybe :. Construction Wye) := a) -> Binary a)
-> ((Maybe :. Construction Wye) := a) -> Binary a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
$ Binary a -> (Maybe :. Construction Wye) := a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run (Binary a -> (Maybe :. Construction Wye) := a)
-> (Construction Wye a -> Binary a)
-> Construction Wye a
-> (Maybe :. Construction Wye) := a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
forall (struct :: * -> *).
Morphable ('Rotate ('Left ('Zig 'Zag))) struct =>
struct ~> Morphing ('Rotate ('Left ('Zig 'Zag))) struct
rotate @(Left (Zig Zag)) (Construction Wye a -> (Maybe :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<< Binary a -> Primary Binary a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run Binary a
binary

instance Morphable (Rotate (Right (Zig Zag))) Binary where
	type Morphing (Rotate (Right (Zig Zag))) Binary = Binary
	morphing :: (<:.>) (Tagged ('Rotate ('Right ('Zig 'Zag)))) Binary a
-> Morphing ('Rotate ('Right ('Zig 'Zag))) Binary a
morphing ((<:.>) (Tagged ('Rotate ('Right ('Zig 'Zag)))) Binary a -> Binary a
forall k (mod :: k) (struct :: * -> *).
Morphable mod struct =>
(Tagged mod <:.> struct) ~> struct
premorph -> Binary a
binary) = ((Maybe :. Construction Wye) := a) -> Binary a
forall (t :: * -> *) a. Interpreted t => Primary t a -> t a
unite (((Maybe :. Construction Wye) := a) -> Binary a)
-> ((Maybe :. Construction Wye) := a) -> Binary a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
$ Binary a -> (Maybe :. Construction Wye) := a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run (Binary a -> (Maybe :. Construction Wye) := a)
-> (Construction Wye a -> Binary a)
-> Construction Wye a
-> (Maybe :. Construction Wye) := a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
forall (struct :: * -> *).
Morphable ('Rotate ('Right ('Zig 'Zag))) struct =>
struct ~> Morphing ('Rotate ('Right ('Zig 'Zag))) struct
rotate @(Right (Zig Zag)) (Construction Wye a -> (Maybe :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<< Binary a -> Primary Binary a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run Binary a
binary

-------------------------------------- Non-empty Splay tree ----------------------------------------

instance Morphable (Rotate (Left Zig)) (Construction Wye) where
	type Morphing (Rotate (Left Zig)) (Construction Wye) = Binary
	morphing :: forall a . (:#) (Rotate (Left Zig)) <:.> Construction Wye := a -> Binary a
	morphing :: (((:#) ('Rotate ('Left 'Zig)) <:.> Construction Wye) := a)
-> Binary a
morphing ((((:#) ('Rotate ('Left 'Zig)) <:.> Construction Wye) := a)
-> Construction Wye a
forall k (mod :: k) (struct :: * -> *).
Morphable mod struct =>
(Tagged mod <:.> struct) ~> struct
premorph -> Construct a
x (Wye :. Construction Wye) := a
xs) = ((Maybe :. Construction Wye) := a) -> Binary a
forall k k k k (ct :: k) (cu :: k) (t :: k -> *) (u :: k -> k)
       (a :: k).
((t :. u) := a) -> TU ct cu t u a
TU (((Maybe :. Construction Wye) := a) -> Binary a)
-> ((Maybe :. Construction Wye) := a) -> Binary a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
$ a -> ((Wye :. Construction Wye) := a) -> Construction Wye a
forall (t :: * -> *) a.
a -> ((t :. Construction t) := a) -> Construction t a
Construct (a -> ((Wye :. Construction Wye) := a) -> Construction Wye a)
-> Maybe a
-> Maybe (((Wye :. Construction Wye) := a) -> Construction Wye a)
forall (source :: * -> * -> *) (target :: * -> * -> *)
       (t :: * -> *) a b.
Covariant source target t =>
source a b -> target (t a) (t b)
-<$>- Maybe a
parent Maybe (((Wye :. Construction Wye) := a) -> Construction Wye a)
-> Maybe ((Wye :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (t :: * -> *) a b.
(Covariant (->) (->) t, Semimonoidal (->) (:*:) (:*:) t) =>
t (a -> b) -> t a -> t b
-<*>- ((Wye :. Construction Wye) := a)
-> Maybe ((Wye :. Construction Wye) := a)
forall a. a -> Maybe a
Just (Wye :. Nonempty Binary) := a
(Wye :. Construction Wye) := a
nodes where

		nodes :: Wye :. Nonempty Binary := a
		nodes :: (Wye :. Nonempty Binary) := a
nodes = forall a (mod :: a) (struct :: * -> *).
Morphable ('Into mod) struct =>
struct ~> Morphing ('Into mod) struct
forall (struct :: * -> *).
Morphable ('Into Wye) struct =>
struct ~> Morphing ('Into Wye) struct
into @Wye (T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
 -> (Wye :. Construction Wye) := a)
-> (T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
    -> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a))
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
-> (Wye :. Construction Wye) := a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. ((Maybe :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
forall k (t :: k -> *) (a :: k) (u :: k -> *).
t a -> u a -> (<:.:>) t u (:*:) a
twosome (((Wye :. Construction Wye) := a)
-> Morphing ('Into ('Left Maybe)) Wye (Construction Wye a)
forall a (b :: (* -> *) -> a).
Morphable ('Into (b Maybe)) Wye =>
Wye ~> Morphing ('Into (b Maybe)) Wye
branch @Left (Wye :. Construction Wye) := a
xs) (((Maybe :. Construction Wye) := a)
 -> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a))
-> (T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
    -> (Maybe :. Construction Wye) := a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. Construction Wye a -> (Maybe :. Construction Wye) := a
forall a. a -> Maybe a
Just (Construction Wye a -> (Maybe :. Construction Wye) := a)
-> (T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
    -> Construction Wye a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
-> (Maybe :. Construction Wye) := a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. a -> ((Wye :. Construction Wye) := a) -> Construction Wye a
forall (t :: * -> *) a.
a -> ((t :. Construction t) := a) -> Construction t a
Construct a
x
			(((Wye :. Construction Wye) := a) -> Construction Wye a)
-> (T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
    -> (Wye :. Construction Wye) := a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
-> Construction Wye a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. forall a (mod :: a) (struct :: * -> *).
Morphable ('Into mod) struct =>
struct ~> Morphing ('Into mod) struct
forall (struct :: * -> *).
Morphable ('Into Wye) struct =>
struct ~> Morphing ('Into Wye) struct
into @Wye (T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
 -> (Wye :. Construction Wye) := a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
-> (Wye :. Construction Wye) := a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
$ ((Maybe :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
forall k (t :: k -> *) (a :: k) (u :: k -> *).
t a -> u a -> (<:.:>) t u (:*:) a
twosome (Morphable ('Into ('Left Maybe)) Wye =>
Wye ~> Morphing ('Into ('Left Maybe)) Wye
forall a (b :: (* -> *) -> a).
Morphable ('Into (b Maybe)) Wye =>
Wye ~> Morphing ('Into (b Maybe)) Wye
branch @Left (((Wye :. Construction Wye) := a)
 -> (Maybe :. Construction Wye) := a)
-> Maybe ((Wye :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<< Construction Wye a -> (Wye :. Construction Wye) := a
forall (t :: * -> *) a.
Construction t a -> (t :. Construction t) := a
deconstruct (Construction Wye a -> (Wye :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> Maybe ((Wye :. Construction Wye) := a)
forall (source :: * -> * -> *) (target :: * -> * -> *)
       (t :: * -> *) a b.
Covariant source target t =>
source a b -> target (t a) (t b)
-<$>- ((Wye :. Construction Wye) := a)
-> Morphing ('Into ('Right Maybe)) Wye (Construction Wye a)
forall a (b :: (* -> *) -> a).
Morphable ('Into (b Maybe)) Wye =>
Wye ~> Morphing ('Into (b Maybe)) Wye
branch @Right (Wye :. Construction Wye) := a
xs)
				(Morphable ('Into ('Right Maybe)) Wye =>
Wye ~> Morphing ('Into ('Right Maybe)) Wye
forall a (b :: (* -> *) -> a).
Morphable ('Into (b Maybe)) Wye =>
Wye ~> Morphing ('Into (b Maybe)) Wye
branch @Right (((Wye :. Construction Wye) := a)
 -> (Maybe :. Construction Wye) := a)
-> Maybe ((Wye :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<< Construction Wye a -> (Wye :. Construction Wye) := a
forall (t :: * -> *) a.
Construction t a -> (t :. Construction t) := a
deconstruct (Construction Wye a -> (Wye :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> Maybe ((Wye :. Construction Wye) := a)
forall (source :: * -> * -> *) (target :: * -> * -> *)
       (t :: * -> *) a b.
Covariant source target t =>
source a b -> target (t a) (t b)
-<$>- ((Wye :. Construction Wye) := a)
-> Morphing ('Into ('Right Maybe)) Wye (Construction Wye a)
forall a (b :: (* -> *) -> a).
Morphable ('Into (b Maybe)) Wye =>
Wye ~> Morphing ('Into (b Maybe)) Wye
branch @Right (Wye :. Construction Wye) := a
xs)

		parent :: Maybe a
		parent :: Maybe a
parent = Construction Wye a -> a
forall (t :: * -> *) a. Extractable_ t => t a -> a
extract (Construction Wye a -> a)
-> ((Maybe :. Construction Wye) := a) -> Maybe a
forall (source :: * -> * -> *) (target :: * -> * -> *)
       (t :: * -> *) a b.
Covariant source target t =>
source a b -> target (t a) (t b)
-<$>- ((Wye :. Construction Wye) := a)
-> Morphing ('Into ('Right Maybe)) Wye (Construction Wye a)
forall a (b :: (* -> *) -> a).
Morphable ('Into (b Maybe)) Wye =>
Wye ~> Morphing ('Into (b Maybe)) Wye
branch @Right (Wye :. Construction Wye) := a
xs

instance Morphable (Rotate (Right Zig)) (Construction Wye) where
	type Morphing (Rotate (Right Zig)) (Construction Wye) = Binary
	morphing :: forall a . (:#) (Rotate (Right Zig)) <:.> Construction Wye := a -> Binary a
	morphing :: (((:#) ('Rotate ('Right 'Zig)) <:.> Construction Wye) := a)
-> Binary a
morphing ((((:#) ('Rotate ('Right 'Zig)) <:.> Construction Wye) := a)
-> Construction Wye a
forall k (mod :: k) (struct :: * -> *).
Morphable mod struct =>
(Tagged mod <:.> struct) ~> struct
premorph -> Construct a
x (Wye :. Construction Wye) := a
xs) = ((Maybe :. Construction Wye) := a) -> Binary a
forall k k k k (ct :: k) (cu :: k) (t :: k -> *) (u :: k -> k)
       (a :: k).
((t :. u) := a) -> TU ct cu t u a
TU (((Maybe :. Construction Wye) := a) -> Binary a)
-> ((Maybe :. Construction Wye) := a) -> Binary a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
$ a -> ((Wye :. Construction Wye) := a) -> Construction Wye a
forall (t :: * -> *) a.
a -> ((t :. Construction t) := a) -> Construction t a
Construct (a -> ((Wye :. Construction Wye) := a) -> Construction Wye a)
-> Maybe a
-> Maybe (((Wye :. Construction Wye) := a) -> Construction Wye a)
forall (source :: * -> * -> *) (target :: * -> * -> *)
       (t :: * -> *) a b.
Covariant source target t =>
source a b -> target (t a) (t b)
-<$>- Maybe a
parent Maybe (((Wye :. Construction Wye) := a) -> Construction Wye a)
-> Maybe ((Wye :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (t :: * -> *) a b.
(Covariant (->) (->) t, Semimonoidal (->) (:*:) (:*:) t) =>
t (a -> b) -> t a -> t b
-<*>- ((Wye :. Construction Wye) := a)
-> Maybe ((Wye :. Construction Wye) := a)
forall a. a -> Maybe a
Just (Wye :. Nonempty Binary) := a
(Wye :. Construction Wye) := a
nodes where

		nodes :: Wye :. Nonempty Binary := a
		nodes :: (Wye :. Nonempty Binary) := a
nodes = forall a (mod :: a) (struct :: * -> *).
Morphable ('Into mod) struct =>
struct ~> Morphing ('Into mod) struct
forall (struct :: * -> *).
Morphable ('Into Wye) struct =>
struct ~> Morphing ('Into Wye) struct
into @Wye (T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
 -> (Wye :. Construction Wye) := a)
-> (T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
    -> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a))
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
-> (Wye :. Construction Wye) := a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. ((Maybe :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
forall k (t :: k -> *) (a :: k) (u :: k -> *).
t a -> u a -> (<:.:>) t u (:*:) a
twosome (Morphable ('Into ('Left Maybe)) Wye =>
Wye ~> Morphing ('Into ('Left Maybe)) Wye
forall a (b :: (* -> *) -> a).
Morphable ('Into (b Maybe)) Wye =>
Wye ~> Morphing ('Into (b Maybe)) Wye
branch @Left (((Wye :. Construction Wye) := a)
 -> (Maybe :. Construction Wye) := a)
-> Maybe ((Wye :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<< Construction Wye a -> (Wye :. Construction Wye) := a
forall (t :: * -> *) a.
Construction t a -> (t :. Construction t) := a
deconstruct (Construction Wye a -> (Wye :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> Maybe ((Wye :. Construction Wye) := a)
forall (source :: * -> * -> *) (target :: * -> * -> *)
       (t :: * -> *) a b.
Covariant source target t =>
source a b -> target (t a) (t b)
-<$>- ((Wye :. Construction Wye) := a)
-> Morphing ('Into ('Left Maybe)) Wye (Construction Wye a)
forall a (b :: (* -> *) -> a).
Morphable ('Into (b Maybe)) Wye =>
Wye ~> Morphing ('Into (b Maybe)) Wye
branch @Left (Wye :. Construction Wye) := a
xs) (((Maybe :. Construction Wye) := a)
 -> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a))
-> (T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
    -> (Maybe :. Construction Wye) := a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. Construction Wye a -> (Maybe :. Construction Wye) := a
forall a. a -> Maybe a
Just (Construction Wye a -> (Maybe :. Construction Wye) := a)
-> (T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
    -> Construction Wye a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
-> (Maybe :. Construction Wye) := a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. a -> ((Wye :. Construction Wye) := a) -> Construction Wye a
forall (t :: * -> *) a.
a -> ((t :. Construction t) := a) -> Construction t a
Construct a
x
			(((Wye :. Construction Wye) := a) -> Construction Wye a)
-> (T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
    -> (Wye :. Construction Wye) := a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
-> Construction Wye a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. forall a (mod :: a) (struct :: * -> *).
Morphable ('Into mod) struct =>
struct ~> Morphing ('Into mod) struct
forall (struct :: * -> *).
Morphable ('Into Wye) struct =>
struct ~> Morphing ('Into Wye) struct
into @Wye (T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
 -> (Wye :. Construction Wye) := a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
-> (Wye :. Construction Wye) := a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
$ ((Maybe :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
forall k (t :: k -> *) (a :: k) (u :: k -> *).
t a -> u a -> (<:.:>) t u (:*:) a
twosome (Morphable ('Into ('Right Maybe)) Wye =>
Wye ~> Morphing ('Into ('Right Maybe)) Wye
forall a (b :: (* -> *) -> a).
Morphable ('Into (b Maybe)) Wye =>
Wye ~> Morphing ('Into (b Maybe)) Wye
branch @Right (((Wye :. Construction Wye) := a)
 -> (Maybe :. Construction Wye) := a)
-> Maybe ((Wye :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<< Construction Wye a -> (Wye :. Construction Wye) := a
forall (t :: * -> *) a.
Construction t a -> (t :. Construction t) := a
deconstruct (Construction Wye a -> (Wye :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> Maybe ((Wye :. Construction Wye) := a)
forall (source :: * -> * -> *) (target :: * -> * -> *)
       (t :: * -> *) a b.
Covariant source target t =>
source a b -> target (t a) (t b)
-<$>- ((Wye :. Construction Wye) := a)
-> Morphing ('Into ('Left Maybe)) Wye (Construction Wye a)
forall a (b :: (* -> *) -> a).
Morphable ('Into (b Maybe)) Wye =>
Wye ~> Morphing ('Into (b Maybe)) Wye
branch @Left (Wye :. Construction Wye) := a
xs) (((Maybe :. Construction Wye) := a)
 -> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a))
-> ((Maybe :. Construction Wye) := a)
-> T_U Covariant Covariant (:*:) Maybe Maybe (Construction Wye a)
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
# ((Wye :. Construction Wye) := a)
-> Morphing ('Into ('Right Maybe)) Wye (Construction Wye a)
forall a (b :: (* -> *) -> a).
Morphable ('Into (b Maybe)) Wye =>
Wye ~> Morphing ('Into (b Maybe)) Wye
branch @Right (Wye :. Construction Wye) := a
xs

		parent :: Maybe a
		parent :: Maybe a
parent = Construction Wye a -> a
forall (t :: * -> *) a. Extractable_ t => t a -> a
extract (Construction Wye a -> a)
-> ((Maybe :. Construction Wye) := a) -> Maybe a
forall (source :: * -> * -> *) (target :: * -> * -> *)
       (t :: * -> *) a b.
Covariant source target t =>
source a b -> target (t a) (t b)
-<$>- ((Wye :. Construction Wye) := a)
-> Morphing ('Into ('Left Maybe)) Wye (Construction Wye a)
forall a (b :: (* -> *) -> a).
Morphable ('Into (b Maybe)) Wye =>
Wye ~> Morphing ('Into (b Maybe)) Wye
branch @Left (Wye :. Construction Wye) := a
xs

-- TODO: Morphing ... = Conclussion Error <:.> Nonempty Binary
instance Morphable (Rotate (Left (Zig Zig))) (Construction Wye) where
	type Morphing (Rotate (Left (Zig Zig))) (Construction Wye) = Binary
	morphing :: (<:.>) (Tagged ('Rotate ('Left ('Zig 'Zig)))) (Construction Wye) a
-> Morphing ('Rotate ('Left ('Zig 'Zig))) (Construction Wye) a
morphing ((<:.>) (Tagged ('Rotate ('Left ('Zig 'Zig)))) (Construction Wye) a
-> Construction Wye a
forall k (mod :: k) (struct :: * -> *).
Morphable mod struct =>
(Tagged mod <:.> struct) ~> struct
premorph -> Construction Wye a
tree) = ((Maybe :. Construction Wye) := a)
-> TU Covariant Covariant Maybe (Construction Wye) a
forall k k k k (ct :: k) (cu :: k) (t :: k -> *) (u :: k -> k)
       (a :: k).
((t :. u) := a) -> TU ct cu t u a
TU (((Maybe :. Construction Wye) := a)
 -> TU Covariant Covariant Maybe (Construction Wye) a)
-> ((Maybe :. Construction Wye) := a)
-> TU Covariant Covariant Maybe (Construction Wye) a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
$ TU Covariant Covariant Maybe (Construction Wye) a
-> (Maybe :. Construction Wye) := a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run (TU Covariant Covariant Maybe (Construction Wye) a
 -> (Maybe :. Construction Wye) := a)
-> (Construction Wye a
    -> TU Covariant Covariant Maybe (Construction Wye) a)
-> Construction Wye a
-> (Maybe :. Construction Wye) := a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
forall (struct :: * -> *).
Morphable ('Rotate ('Left 'Zig)) struct =>
struct ~> Morphing ('Rotate ('Left 'Zig)) struct
rotate @(Left Zig) (Construction Wye a -> (Maybe :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<< TU Covariant Covariant Maybe (Construction Wye) a
-> (Maybe :. Construction Wye) := a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run (TU Covariant Covariant Maybe (Construction Wye) a
 -> (Maybe :. Construction Wye) := a)
-> TU Covariant Covariant Maybe (Construction Wye) a
-> (Maybe :. Construction Wye) := a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
# Construction Wye a
-> Morphing ('Rotate ('Left 'Zig)) (Construction Wye) a
forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
rotate @(Left Zig) Construction Wye a
tree

-- TODO: Morphing ... = Conclussion Error <:.> Nonempty Binary
instance Morphable (Rotate (Right (Zig Zig))) (Construction Wye) where
	type Morphing (Rotate (Right (Zig Zig))) (Construction Wye) = Binary
	morphing :: (<:.>) (Tagged ('Rotate ('Right ('Zig 'Zig)))) (Construction Wye) a
-> Morphing ('Rotate ('Right ('Zig 'Zig))) (Construction Wye) a
morphing ((<:.>) (Tagged ('Rotate ('Right ('Zig 'Zig)))) (Construction Wye) a
-> Construction Wye a
forall k (mod :: k) (struct :: * -> *).
Morphable mod struct =>
(Tagged mod <:.> struct) ~> struct
premorph -> Construction Wye a
tree) = ((Maybe :. Construction Wye) := a)
-> TU Covariant Covariant Maybe (Construction Wye) a
forall k k k k (ct :: k) (cu :: k) (t :: k -> *) (u :: k -> k)
       (a :: k).
((t :. u) := a) -> TU ct cu t u a
TU (((Maybe :. Construction Wye) := a)
 -> TU Covariant Covariant Maybe (Construction Wye) a)
-> ((Maybe :. Construction Wye) := a)
-> TU Covariant Covariant Maybe (Construction Wye) a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
$ TU Covariant Covariant Maybe (Construction Wye) a
-> (Maybe :. Construction Wye) := a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run (TU Covariant Covariant Maybe (Construction Wye) a
 -> (Maybe :. Construction Wye) := a)
-> (Construction Wye a
    -> TU Covariant Covariant Maybe (Construction Wye) a)
-> Construction Wye a
-> (Maybe :. Construction Wye) := a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
forall (struct :: * -> *).
Morphable ('Rotate ('Right 'Zig)) struct =>
struct ~> Morphing ('Rotate ('Right 'Zig)) struct
rotate @(Right Zig) (Construction Wye a -> (Maybe :. Construction Wye) := a)
-> ((Maybe :. Construction Wye) := a)
-> (Maybe :. Construction Wye) := a
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<< TU Covariant Covariant Maybe (Construction Wye) a
-> (Maybe :. Construction Wye) := a
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run (TU Covariant Covariant Maybe (Construction Wye) a
 -> (Maybe :. Construction Wye) := a)
-> TU Covariant Covariant Maybe (Construction Wye) a
-> (Maybe :. Construction Wye) := a
forall (m :: * -> * -> *) a b. Category m => m (m a b) (m a b)
# Construction Wye a
-> Morphing ('Rotate ('Right 'Zig)) (Construction Wye) a
forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
rotate @(Right Zig) Construction Wye a
tree

-- TODO: Morphing ... = Conclussion Error <:.> Nonempty Binary
instance Morphable (Rotate (Left (Zig Zag))) (Construction Wye) where
	type Morphing (Rotate (Left (Zig Zag))) (Construction Wye) = Binary
	morphing :: (<:.>) (Tagged ('Rotate ('Left ('Zig 'Zag)))) (Construction Wye) a
-> Morphing ('Rotate ('Left ('Zig 'Zag))) (Construction Wye) a
morphing = forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
forall (struct :: * -> *).
Morphable ('Rotate ('Left 'Zig)) struct =>
struct ~> Morphing ('Rotate ('Left 'Zig)) struct
rotate @(Left Zig) (Construction Wye a -> Binary a)
-> ((<:.>)
      (Tagged ('Rotate ('Left ('Zig 'Zag)))) (Construction Wye) a
    -> Construction Wye a)
-> (<:.>)
     (Tagged ('Rotate ('Left ('Zig 'Zag)))) (Construction Wye) a
-> Binary a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. Lens Maybe (Construction Wye a) (Construction Wye a)
-> (Maybe (Construction Wye a) -> Maybe (Construction Wye a))
-> Construction Wye a
-> Construction Wye a
forall (available :: * -> *) source target.
Lens available source target
-> (available target -> available target) -> source -> source
over (forall k (segment :: k) (structure :: * -> *).
(Substructure segment structure, Covariant (->) (->) structure) =>
(structure #=@ Substance segment structure)
:= Available segment structure
forall (structure :: * -> *).
(Substructure 'Left structure, Covariant (->) (->) structure) =>
(structure #=@ Substance 'Left structure)
:= Available 'Left structure
sub @Left) (Binary a -> Maybe (Construction Wye a)
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run (Binary a -> Maybe (Construction Wye a))
-> (Construction Wye a -> Binary a)
-> Construction Wye a
-> Maybe (Construction Wye a)
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
forall (struct :: * -> *).
Morphable ('Rotate ('Right 'Zig)) struct =>
struct ~> Morphing ('Rotate ('Right 'Zig)) struct
rotate @(Right Zig) (Construction Wye a -> Maybe (Construction Wye a))
-> Maybe (Construction Wye a) -> Maybe (Construction Wye a)
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<<) (Construction Wye a -> Construction Wye a)
-> ((<:.>)
      (Tagged ('Rotate ('Left ('Zig 'Zag)))) (Construction Wye) a
    -> Construction Wye a)
-> (<:.>)
     (Tagged ('Rotate ('Left ('Zig 'Zag)))) (Construction Wye) a
-> Construction Wye a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. (<:.>) (Tagged ('Rotate ('Left ('Zig 'Zag)))) (Construction Wye) a
-> Construction Wye a
forall k (mod :: k) (struct :: * -> *).
Morphable mod struct =>
(Tagged mod <:.> struct) ~> struct
premorph

-- TODO: Morphing ... = Conclussion Error <:.> Nonempty Binary
instance Morphable (Rotate (Right (Zig Zag))) (Construction Wye) where
	type Morphing (Rotate (Right (Zig Zag))) (Construction Wye) = Binary
	morphing :: (<:.>) (Tagged ('Rotate ('Right ('Zig 'Zag)))) (Construction Wye) a
-> Morphing ('Rotate ('Right ('Zig 'Zag))) (Construction Wye) a
morphing = forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
forall (struct :: * -> *).
Morphable ('Rotate ('Right 'Zig)) struct =>
struct ~> Morphing ('Rotate ('Right 'Zig)) struct
rotate @(Right Zig) (Construction Wye a -> Binary a)
-> ((<:.>)
      (Tagged ('Rotate ('Right ('Zig 'Zag)))) (Construction Wye) a
    -> Construction Wye a)
-> (<:.>)
     (Tagged ('Rotate ('Right ('Zig 'Zag)))) (Construction Wye) a
-> Binary a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. Lens Maybe (Construction Wye a) (Construction Wye a)
-> (Maybe (Construction Wye a) -> Maybe (Construction Wye a))
-> Construction Wye a
-> Construction Wye a
forall (available :: * -> *) source target.
Lens available source target
-> (available target -> available target) -> source -> source
over (forall k (segment :: k) (structure :: * -> *).
(Substructure segment structure, Covariant (->) (->) structure) =>
(structure #=@ Substance segment structure)
:= Available segment structure
forall (structure :: * -> *).
(Substructure 'Right structure, Covariant (->) (->) structure) =>
(structure #=@ Substance 'Right structure)
:= Available 'Right structure
sub @Right) (Binary a -> Maybe (Construction Wye a)
forall (t :: * -> *) a. Interpreted t => t a -> Primary t a
run (Binary a -> Maybe (Construction Wye a))
-> (Construction Wye a -> Binary a)
-> Construction Wye a
-> Maybe (Construction Wye a)
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. forall a (mod :: a) (struct :: * -> *).
Morphable ('Rotate mod) struct =>
struct ~> Morphing ('Rotate mod) struct
forall (struct :: * -> *).
Morphable ('Rotate ('Left 'Zig)) struct =>
struct ~> Morphing ('Rotate ('Left 'Zig)) struct
rotate @(Left Zig) (Construction Wye a -> Maybe (Construction Wye a))
-> Maybe (Construction Wye a) -> Maybe (Construction Wye a)
forall (source :: * -> * -> *) (t :: * -> *) a b.
Bindable source t =>
source a (t b) -> source (t a) (t b)
=<<) (Construction Wye a -> Construction Wye a)
-> ((<:.>)
      (Tagged ('Rotate ('Right ('Zig 'Zag)))) (Construction Wye) a
    -> Construction Wye a)
-> (<:.>)
     (Tagged ('Rotate ('Right ('Zig 'Zag)))) (Construction Wye) a
-> Construction Wye a
forall (m :: * -> * -> *) b c a.
Semigroupoid m =>
m b c -> m a b -> m a c
. (<:.>) (Tagged ('Rotate ('Right ('Zig 'Zag)))) (Construction Wye) a
-> Construction Wye a
forall k (mod :: k) (struct :: * -> *).
Morphable mod struct =>
(Tagged mod <:.> struct) ~> struct
premorph

branch :: forall b . Morphable (Into (b Maybe)) Wye => Wye ~> Morphing (Into (b Maybe)) Wye
branch :: Wye ~> Morphing ('Into (b Maybe)) Wye
branch = forall a (mod :: a) (struct :: * -> *).
Morphable ('Into mod) struct =>
struct ~> Morphing ('Into mod) struct
forall (struct :: * -> *).
Morphable ('Into (b Maybe)) struct =>
struct ~> Morphing ('Into (b Maybe)) struct
into @(b Maybe)