Skip to content

Instantly share code, notes, and snippets.

@kosmikus
Created April 7, 2016 12:56
Show Gist options
  • Save kosmikus/f64a05473ac5c021f9ae3130817fc0f6 to your computer and use it in GitHub Desktop.
Save kosmikus/f64a05473ac5c021f9ae3130817fc0f6 to your computer and use it in GitHub Desktop.
type PermApi1 =
"a" :> "b" :> "c" :> Get '[JSON] ()
:<|> "b" :> "a" :> "c" :> Get '[JSON] ()
:<|> "a" :> "c" :> "b" :> Get '[JSON] ()
:<|> "c" :> "a" :> "b" :> Get '[JSON] ()
:<|> "b" :> "c" :> "a" :> Get '[JSON] ()
:<|> "c" :> "b" :> "a" :> Get '[JSON] ()
Output:
<root>
├─ a
│ ├─ b
│ │ └─ c
│ │ └─•
│ └─ c
│ └─ b
│ └─•
├─ b
│ ├─ a
│ │ └─ c
│ │ └─•
│ └─ c
│ └─ a
│ └─•
└─ c
├─ a
│ └─ b
│ └─•
└─ b
└─ a
└─•
type PermApi2 =
"a" :> "b" :> "c" :> Get '[JSON] ()
:<|> "b" :> "a" :> "c" :> Get '[JSON] ()
:<|> "a" :> "c" :> "b" :> Get '[JSON] ()
:<|> "c" :> "a" :> "b" :> Get '[JSON] ()
:<|> "b" :> "c" :> "a" :> Get '[JSON] ()
:<|> "c" :> "b" :> "a" :> Get '[JSON] ()
:<|> Raw
Output:
<root>
├─ a
│ └─ b
│ └─ c
│ └─•
├─ b
│ └─ a
│ └─ c
│ └─•
├─ a
│ └─ c
│ └─ b
│ └─•
├─ c
│ └─ a
│ └─ b
│ └─•
├─ b
│ └─ c
│ └─ a
│ └─•
├─ c
│ └─ b
│ └─ a
│ └─•
└─•
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment