Skip to content

Instantly share code, notes, and snippets.

@farukg
Last active November 15, 2022 18:25
Show Gist options
  • Save farukg/cf62675b46c4c811f1a1b523c712b46d to your computer and use it in GitHub Desktop.
Save farukg/cf62675b46c4c811f1a1b523c712b46d to your computer and use it in GitHub Desktop.
type connType = Wifi
type login =
| Admin
| Regular
type connected = {
connType,
login,
}
type conn =
| Connected(connected)
| NoConnection
let anyFunction =
fun
| Connected({connType: Wifi, login: Admin}) => seeAdminPanel()
| Connected({connType: Wifi, login: Regular}) => debugPrint("Must be admin...")
| NoConnection => debugPrint("Must be connected and logged in...")
@farukg
Copy link
Author

farukg commented Nov 15, 2022

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment