小编Ale*_*esi的帖子

如何在Yesod中更改子网站的URL?

是否可以在Yesod中重命名子网站的端点?

例如,我不想使用yesod-auth提供的/ login/ email/register,而是将它们称为"/ entrar"和"/ cadastrar"(分别是他们的PT-BR对应物).

我设法做到这一点的唯一方法是设置我stack.yaml使用修改后的本地副本yesod-auth,但我想知道是否有更好的方法.

haskell yesod

7
推荐指数
1
解决办法
136
查看次数

GHCi中的奇怪行为

我写了下面这段代码:

it :: Int -> Int
it n
    | n < 1     = error "Invalid entry."
    | n == 1    = 0
    | otherwise = 1 + it (n `quot` 2)
Run Code Online (Sandbox Code Playgroud)

当我将它加载到GHCi中时,会发生一些奇怪的事情.我第一次调用该函数时it,它工作正常并返回预期的结果.但是,下一次,我得到以下崩溃:

?: :t it
it :: Int -> Int
?: it 2
1
?: it 2

<interactive>:4:1:
    Couldn't match expected type `a0 -> t0' with actual type `Int'
    The function `it' is applied to one argument,
    but its type `Int' has none
    In the expression: it 2 …
Run Code Online (Sandbox Code Playgroud)

haskell ghci

5
推荐指数
1
解决办法
85
查看次数

标签 统计

haskell ×2

ghci ×1

yesod ×1