'Combining modules fails

I want to connect all the models but I always get those cycle-errors.

My whole model looks like this:

type alias Model =
    { users : List User
    , blogs : List Blog
    , posts : List Post
    , comments : List Comment
    , labels : List Label
    }

Sadly there appears the error message:

Your module imports form a cycle:
  
  ┌─────┐
  │    Features.User
  │     ↓
  │    Features.Blog
  │     ↓
  │    Features.Label
  │     ↓
  │    Features.Post
  │     ↓
  │    Features.Comment
  └─────┘

This is the user file:

module Features.User exposing (..)

import Features.Blog as Blog
import Features.Comment as Comment
import Features.Post as Post


type alias Id =
    String


type alias User =
    { id : String
    , name : String
    , email : String
    , password : String
    , blogs : List Blog.Id
    , posts : List Post.Id
    , comments : List Comment.Id
    }

I would love to get some input how to restructure the code so that it works just fine. Thanks.

elm


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source