| 
 Module         : Faker . Name 
 Description    : Module for generating fake names and titles 
 Copyright      : ( c )   , 2014 - 2018 
 License        : MIT 
 Maintainer     :  
 Stability      : experimental 
 Portability    : POSIX 

 Fake data 

Module        : Faker.Name
Description   : Module for generating fake names and titles
Copyright     : (c) Alexey Gaziev, 2014-2018
License       : MIT
Maintainer    : 
Stability     : experimental
Portability   : POSIX

Fake data
-}
module Faker.Name
  (
  -- * Functions for generate fake names and titles
    firstName
  , lastName
  , prefix
  , suffix
  , name
  , title
  )
  where

import           Faker.Utils

  | Returns random full name , sometimes with  or suffix , i.e.
  "    "
name :: Faker String
name = do
  ind <- randomInt (0,6)
  pref <- prefix
  suff <- suffix
  fName <- firstName
  lName <- lastName
  return $ case ind of
    0 -> unwords [pref, fName, lName]
    1 -> unwords [fName, lName, suff]
    _ -> fName ++ " " ++ lName

  | Returns random first name , i.e. "  "
firstName :: Faker String
firstName = randomName "first_name"

  | Returns random last name , i.e. "  "
lastName :: Faker String
lastName = randomName "last_name"

-- | Returns random prefix, i.e. "Miss"
prefix :: Faker String
prefix = randomName "prefix"

  | Returns random suffix , i.e. "  "
suffix :: Faker String
suffix = randomName "suffix"

  | Returns random title , i.e. " Principal Configuration Assistant "
title :: Faker String
title = do
  descriptor <- randomTitle "descriptor"
  level      <- randomTitle "level"
  job        <- randomTitle "job"
  return $ unwords [descriptor, level, job]

randomName :: String -> Faker String
randomName = randomValue "name"

randomTitle :: String -> Faker String
randomTitle = randomValue "title"

 * Functions for generate fake names and titles
 | Returns random prefix, i.e. "Miss"
| 
 Module         : Faker . Name 
 Description    : Module for generating fake names and titles 
 Copyright      : ( c )   , 2014 - 2018 
 License        : MIT 
 Maintainer     :  
 Stability      : experimental 
 Portability    : POSIX 

 Fake data 

Module        : Faker.Name
Description   : Module for generating fake names and titles
Copyright     : (c) Alexey Gaziev, 2014-2018
License       : MIT
Maintainer    : 
Stability     : experimental
Portability   : POSIX

Fake data
-}
module Faker.Name
  (
    firstName
  , lastName
  , prefix
  , suffix
  , name
  , title
  )
  where

import           Faker.Utils

  | Returns random full name , sometimes with  or suffix , i.e.
  "    "
name :: Faker String
name = do
  ind <- randomInt (0,6)
  pref <- prefix
  suff <- suffix
  fName <- firstName
  lName <- lastName
  return $ case ind of
    0 -> unwords [pref, fName, lName]
    1 -> unwords [fName, lName, suff]
    _ -> fName ++ " " ++ lName

  | Returns random first name , i.e. "  "
firstName :: Faker String
firstName = randomName "first_name"

  | Returns random last name , i.e. "  "
lastName :: Faker String
lastName = randomName "last_name"

prefix :: Faker String
prefix = randomName "prefix"

  | Returns random suffix , i.e. "  "
suffix :: Faker String
suffix = randomName "suffix"

  | Returns random title , i.e. " Principal Configuration Assistant "
title :: Faker String
title = do
  descriptor <- randomTitle "descriptor"
  level      <- randomTitle "level"
  job        <- randomTitle "job"
  return $ unwords [descriptor, level, job]

randomName :: String -> Faker String
randomName = randomValue "name"

randomTitle :: String -> Faker String
randomTitle = randomValue "title"
