Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dminuoso

dminuoso/f.hs Secret

Created May 28, 2021 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dminuoso/53fbd686b59a5f79adb58af773f54294 to your computer and use it in GitHub Desktop.
Save dminuoso/53fbd686b59a5f79adb58af773f54294 to your computer and use it in GitHub Desktop.
getVrf :: [IfIP] -> Comp1 (Maybe Vrf)
getVrf ips = do
vrfs <- traverse findVrf (toListOf opt ips)
case nub vrfs of
[] -> pure Nothing
[x] -> pure (Just x)
_xs -> Nothing <$ configErr (vsep [ "Multiple VRFs present:"
, indent 4 (hyphenList (pretty . vrfName <$> vrfs))
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment